Thursday, December 30, 2010

How to use Telrik Red Ajax Loading Panel in asp.net

Hi ,
RadAjaxLoadingPanel is really very nice control provided by Telrik .
When Ajax using on any application then the application partially post back on sever. User does not have any notification about that . So telrik RadAjaxLoadingPanel being helpful for this .
How to use
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlCountry">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlCountry" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
         <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlCity">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlCity" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="5">
        <table style="width: 100%; height: 100%;">
            <tr style="height: 100%">
                <td align="center" valign="middle" style="width: 100%">
                    <asp:Image ID="Image2" ImageUrl="~/Images/loading5.gif" BorderWidth="0px" Height="32px"
                        Width="32px" AlternateText="Processing Data ...." runat="server"></asp:Image></td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>
In rad ajax manager give the id of  DefaultLoadingPanelID="RadAjaxLoadingPanel1" 
 In <telerik:AjaxUpdatedControl ControlID="ddlCountry" LoadingPanelID="RadAjaxLoadingPanel1" /> give the id of the control which have to be postback. and Loding panel id of loding panel.

Note--> IF you face any problem you can search all the Document related to telrik control demo.
Thanks

Monday, December 13, 2010

Some Important Css syntax;

-moz-transform: rotate(-90deg) --> Using for transform the test vertical(Rotate the test 90 degree from there current position.
-webkit-transform: rotate(90deg)--> same as -moz-transform: rotate(-90deg)

-moz-border-radius: 15px--> Using for border desing.

Sunday, December 5, 2010

Google maps Api key for Local Host

ABQIAAAAygAR3fwEVNKNcBiM9PXxHBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQ4BAF8gRnAH-jczRjX-JJP33mTUg

Tuesday, November 23, 2010

Ajax with asp.net

Hi,
Here i am post the code how to use the ajax in asp.net (.aspx page).
This is the simple example of using ajax in .aspx page.

what is ajax
The core idea behind AJAX is to make the communication with the server asynchronous, so that data is transferred and processed in the background. As a result the user can continue working on the other parts of the page without interruption. In an AJAX-enabled application only the relevant page elements are updated and only when necessary.

In contrast, the traditional synchronous (postback-based) communication requires a full page reload each time data is transferred to/from the server.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="validation.aspx.cs" Inherits="validation" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>




<body>
    <form id="form1" runat="server">
 <asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager>
        <asp:UpdatePanel runat="server">
       <ContentTemplate>
    <asp:Label ID="lbl" runat="server" ></asp:Label>
    <asp:TextBox ID="txt" runat="server"></asp:TextBox>
            </ContentTemplate>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnsubmit" EventName="Click" />
            </Triggers>
             </asp:UpdatePanel>
             <asp:Button ID="btnsubmit" runat="server" Text="button" OnClick="btnsubmit_Click"
            ValidationGroup="grp" />
       </form>
    </body>
   

</html>
 Just use the control under the update panel which is use on the current page.
u can call ajex on button submit event by the bind with <asp:AsyncPostBackTrigger> in which u can give controlid=(id of button) and event=(any event like on mouse over,click.....).


Jquery ajax wid asp.net

<head runat="server">
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        $().ready(function () {
            $('#btn').click(function () {
                $.ajax({
                    type: "POST",
                    contentType: "charset=utf-8",
                    url: "Ajax.aspx",
                    dataType: "json",
                    success: function (data) {
                        $('#txtBox').val("Zeeshan");
                        alert("deepak");
                        $('#txtname').val("deepak")

                    },
                    error: function (data) {
                    }

                });
            });
        });

    </script>
   
</head>
Firstly added the js library in the header session of the page.
$().ready(function () = Its denote the current document is ready to load.
$('#btn').click(function ()= Here

Thanks

Monday, November 22, 2010

Beginner: Cross browser compatibility

Beginner: Cross browser compatibility: "Most important issue in developing web site is cross browser supporting facility.Means o/p of one page is looking different in some browser ..."

Sunday, November 21, 2010

Jqurey file uploding without using server side control.

Hi guys,
for using file uploading control in your site just pick up this code and try to find out the solution.
It's work in a nice way.
Thank's.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
        <title>ColdFusion And AJAX File Upload Demo</title>
     
     <!-- Linked scripts. -->
     <script type="text/javascript" src="jquery-1.2.2.pack.js"></script>
     <script type="text/javascript" src="ajax_upload.js"></script>
     <script>
      $(
 function(){

 var jForm = $( "form:first" );
 
 jForm.submit(
 function( objEvent ){
 var jThis = $( this ); 
 var strName = ("uploader" + (new Date()).getTime());
 
 var jFrame = $( "<iframe name=\"" + strName + "\" src=\"about:blank\" />" );
 
 jFrame.css( "display", "none" );
 
 jFrame.load(
 function( objEvent ){
 var objUploadBody = window.frames[ strName ].document.getElementsByTagName( "body" )[ 0 ];
 
 var jBody = $( objUploadBody );
 
 var objData = eval( "(" + jBody.html() + ")" );
 
 prompt( "Return Data:", objData );
 
 setTimeout(
 function(){
 jFrame.remove();
 },
 100
 );
 }
 );
   
 $( "body:first" ).append( jFrame );
 
 jThis
 .attr( "action", "upload_act.cfm" )
 .attr( "method", "post" )
 .attr( "enctype", "multipart/form-data" )
 .attr( "encoding", "multipart/form-data" )
 .attr( "target", strName )
 ;
 }
 );
 }
 );
 <cfset arrFiles = [] />
  <cfloop
 index="strFileIndex"
 from="1"
 to="10"
 step="1">


 <cfset strField = "upload#strFileIndex#" />
  <cfif (
 StructKeyExists( FORM, strField ) AND
 Len( FORM[ strField ] )
 )>
 
 <!--- Upload file. --->
 <cffile
 action="upload"
 filefield="#strField#"
 destination="#ExpandPath( '~/resume/' )#"
 nameconflict="makeunique"
 />
  <cfset ArrayAppend( arrFiles, CFFILE.ServerFile ) />
 
 </cfif>
 
 </cfloop>
 </script>

    </head>
     <body>
     
     <form>
     
     
     <input type="file" name="upload1" size="60" /><br />
     <br />
     
     <input type="file" name="upload2" size="60" /><br />
     <br />
     
     <input type="submit" value="Upload Files" />
     
     </form>
     
     </body>
</html>

Monday, November 15, 2010

How row indexing is possible in asp.net grid view.

<asp:GridView>
                                                <Columns>
                                                    <asp:TemplateField headertext="s.no">
                                                        <ItemTemplate>
                                                            <%# Container.DataItemIndex + 1 %>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
</grid view>

<%=txtUserName.ClientID%>.value