Thursday, June 18, 2009

Firefox Proxy Server Refused Connection Problem

Simple solution:

Tools > Options > Advanced > Network > Settings. Then simply tick a ‘No Proxy’.

done.

Friday, June 12, 2009

Jquery slide,show,hide problem in masterpage

   1:  <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="Common_UserControls_MasterPage" %>
   2:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   3:  <%@ Register Src="~/Common/UserControls/Login.ascx" TagPrefix="UC" TagName="Login" %>
   4:   
   5:   
   6:  <html xmlns="http://www.w3.org/1999/xhtml">
   7:  <head runat="server">
   8:   
   9:   <title></title>
  10:      
  11:      <link href="../_assets/css/style.css" rel="stylesheet" type="text/css" />
  12:      <link href="../_assets/css/slide.css" rel="stylesheet" type="text/css" />
  13:      <link href="../../JqueryUI/themes/base/ui.all.css" rel="stylesheet" type="text/css" />
  14:      <link href="../../JqueryUI/themes/redmond/jquery-ui-1.7.1.custom.css" rel="stylesheet" type="text/css" />
  15:       <script type="text/javascript"  src='<%=ResolveUrl("../Scripts/jQuery/jquery-1.3.2.min.js")%>'>  </script>
  16:       <script type="text/javascript"  src='<%=ResolveUrl("../Scripts/slide.js")%>'> </script>
  17:       <script type="text/javascript" src='<%=ResolveUrl("../../JqueryUI/ui/ui_demos.js")%>'></script>
  18:      <link href="../_assets/css/jquery.notice.css" rel="stylesheet" type="text/css" />
  19:       <script type="text/javascript" src='<%=ResolveUrl("../Scripts/jQuery/jquery.notice.js")%>'></script>
  20:       <script type="text/javascript" charset="utf-8">
  21:           $(document).ready(function() {
  22:               //Page Flip on hover
  23:               $("#pageflip").hover(function() {
  24:                   $("#pageflip img , .msg_block").stop()
  25:              .animate({
  26:                  width: '307px',
  27:                  height: '319px'
  28:              }, 500);
  29:               }, function() {
  30:                   $("#pageflip img").stop()
  31:              .animate({
  32:                  width: '50px',
  33:                  height: '52px'
  34:              }, 220);
  35:                   $(".msg_block").stop()
  36:              .animate({
  37:                  width: '50px',
  38:                  height: '50px'
  39:              }, 200);
  40:               });
  41:           });
  42:  </script>
  43:      
  44:      
  45:      <script type="text/javascript" src='<%=ResolveUrl("../Scripts/jQuery/jquery.lazyload.mini.js")%>'></script>
  46:      <script src="../Scripts/jQuery/jquery-1.2.6-vsdoc.js" type="text/javascript"></script>  
  47:       <script type="text/javascript" charset="utf-8">
  48:           $(function() {              
  49:               $("img").lazyload({ threshold: 200 });
  50:           });
  51:           
  52:    </script> 
  53:   <script type="text/javascript" src='<%=ResolveUrl("../Scripts/mint.js")%>'></script> 
  54:   <script type="text/javascript" src='<%=ResolveUrl("../Scripts/ui.core.js")%>'></script>
  55:   <script type="text/javascript" src='<%=ResolveUrl("../Scripts/ui.notificationmsg.js")%>'></script> 
  56:  <%-- <script type="text/javascript" src='<%=ResolveUrl("../Scripts/firebug-lite-compressed.js")%>'></script>--%>
  57:   
  58:        <script type="text/javascript">
  59:            $(document).ready(function() {
  60:   
  61:                $('#msg1').notificationmsg({ period: 2500 });
  62:                $('#btnfade').click(onClick);
  63:                $('#btnslide').click(onClick);
  64:                $('#btnslidethru').click(onClick);
  65:                $('#closebutton').click(function() { $('#msg1').notificationmsg('hide'); });
  66:                Center();
  67:                function onClick(e) {
  68:                    debugger;
  69:                    var animStyle = 'slide'
  70:                    if (e.srcElement) {
  71:                        if (e.srcElement.id === 'btnfade') {
  72:                            animStyle = 'fade';
  73:                        }
  74:                        else if (e.srcElement.id === 'btnslide') {
  75:                            animStyle = 'slide';
  76:                        }
  77:                        else {
  78:                            animStyle = 'slidethru';
  79:                        }
  80:                    }
  81:                    else {
  82:                        if (e.target.id === 'btnfade') {
  83:                            animStyle = 'fade';
  84:                        }
  85:                        else if (e.target.id === 'btnslide') {
  86:                            animStyle = 'slide';
  87:                        }
  88:                        else {
  89:                            animStyle = 'slidethru';
  90:                        }
  91:                    }
  92:                    $.ajax({
  93:                        type: "POST",
  94:                        url: "http://localhost/onactiond/Default.aspx/GetMessages",
  95:                        data: "{}",
  96:                        contentType: "application/json; charset=utf-8",
  97:                        dataType: "json",
  98:                        success: function(msg) {
  99:                            debugger;
 100:                            $("#modalbody").text("(" + msg.d + ")");
 101:                            $('#msg1').notificationmsg({ animation: animStyle });
 102:                            $('#msg1').notificationmsg('show');
 103:                        },
 104:                        error: function(xhr, msg, e) {
 105:                            debugger;
 106:                            alert(msg);
 107:                        }
 108:                    });
 109:                }
 110:                function Center() {
 111:                    var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;
 112:                    var height = document.documentElement.clientHeight + document.documentElement.scrollTop;
 113:   
 114:                    var top = ((height + document.documentElement.scrollTop) / 2) - ($('#centerdiv').height() / 2) + "px";
 115:   
 116:                    var left = (width / 2) - ($('#centerdiv').width() / 2) + "px";
 117:                    $('#centerdiv').css({ position: "absolute", top: top, left: left });
 118:                }
 119:   
 120:                $('button.add').click(function() {
 121:                    var abdd = '';
 122:                    $.ajax({
 123:                        type: "POST",
 124:                        url: "http://localhost/onactiond/Simple.aspx/GetTime",
 125:                        data: "{}",
 126:                        contentType: "application/json; charset=utf-8",
 127:                        dataType: "json",
 128:                        success: function(msg) {
 129:                            //$("#ya").attr("value", msg.d);
 130:                            jQuery.noticeAdd({
 131:                                text: msg.d,
 132:                                stay: true
 133:                            });
 134:                        }
 135:                    });
 136:                });
 137:   
 138:                $('button.add2').click(function() {
 139:                    jQuery.noticeAdd({
 140:                        text: 'This is a notification that does not stay',
 141:                        stay: false
 142:                    });
 143:                });
 144:   
 145:                $('button.remove').click(function() {
 146:                    jQuery.noticeRemove($('.notice-item-wrapper'), 400);
 147:                });
 148:   
 149:            }); 
 150:      </script>
 151:      
 152:  <style type="text/css"> 
 153:  img { behavior: url(iepngfix.htc) }
 154:  #pageflip {
 155:      position: relative;
 156:      right: 0; top: 0;
 157:      float: right; 
 158:  }
 159:  #pageflip img {
 160:      width: 50px; height: 52px;
 161:      z-index: 99;
 162:      position: absolute;
 163:      right: 0; top: 0;
 164:      -ms-interpolation-mode: bicubic;
 165:  }
 166:   
 167:  #pageflip .msg_block {
 168:      width: 50px; height: 50px;
 169:      overflow: hidden;
 170:      position: absolute;
 171:      right: 0; top: 0;
 172:         
 173:  background-color:Gray;
 174:   background-image : url(../AppImage/icon-woman.gif);
 175:  }
 176:   
 177:  </style> 
 178:          <asp:ContentPlaceHolder id="head" runat="server"> 
 179:          </asp:ContentPlaceHolder>
 180:          
 181:  </head>
 182:      
 183:   
 184:      <%-- <script type="text/javascript"  language="javascript" >
 185:       $(document).ready(function()
 186:        {
 187:           $("a[href$='.pdf']").before("<img src='../_assets/img/icon_pdf.gif'/>");
 188:         })
 189:       </script>--%>
 190:  <body>
 191:   <img src='<%=ResolveUrl("tracker.aspx")%>'  width="1px" height="1px" alt=""/>
 192:   
 193:      <form id="form1" runat="server">
 194:     <div>
 195:          <div  style="width:100%";> 
 196:      <div id="pageflip"> 
 197:          <a><img src='<%=ResolveUrl("../_assets/img/page_flip.png")%>' alt="" /></a>
 198:          <div class="msg_block"></div> 
 199:      </div> 
 200:      </div>
 201:        <UC:Login runat="server" id="uclogin"></UC:Login> 
 202:       <div>
 203:              <div id="centerdiv" style="display:inline; text-align:center">
 204:                  <input id="btnfade" type="button" value="Get Messages [Fade]" /><br />
 205:                  <input id="btnslide" type="button" value="Get Messages [Slide]" /><br />
 206:                  <input id="btnslidethru" type="button" value="Get Messages [SlideThru]" />
 207:              </div>
 208:              <div id="msg1">
 209:                  <div id="modal">
 210:                      <div class="modaltop">
 211:                          <div class="modaltitle">My Inbox</div>
 212:                          <span id="closebutton" style="CURSOR: hand">
 213:                              <img alt="Hide Popup" src="styles/img/close_vista.gif" border="0" />
 214:                          </span>
 215:                      </div>
 216:                      <div class="modalbody">
 217:                          You received <strong><span id="modalbody"></span></strong>&nbsp;Email(s).
 218:                      </div>
 219:                  </div>
 220:              </div>
 221:          </div>      
 222:          <asp:ContentPlaceHolder id="ContentPlaceHolder1"  runat="server">     
 223:          </asp:ContentPlaceHolder>
 224:           <p class="clearfix"> 
 225:                  <button class="add">Add sticky notice</button> 
 226:                  <button class="add2">Add normal notice</button> 
 227:                  <button class="remove">Revome all notices</button> 
 228:              </p> 
 229:           <asp:ContentPlaceHolder id="ContentPlaceHolderFooter" runat="server">
 230:          </asp:ContentPlaceHolder>
 231:      </div>
 232:      </form> 
 233:  </body> 
 234:  </html>

Jquery slide,show,hide problem in masterpage

   1:  <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="Common_UserControls_MasterPage" %>
   2:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   3:  <%@ Register Src="~/Common/UserControls/Login.ascx" TagPrefix="UC" TagName="Login" %>
   4:   
   5:   
   6:  <html xmlns="http://www.w3.org/1999/xhtml">
   7:  <head runat="server">
   8:   
   9:   <title></title>
  10:      
  11:      <link href="../_assets/css/style.css" rel="stylesheet" type="text/css" />
  12:      <link href="../_assets/css/slide.css" rel="stylesheet" type="text/css" />
  13:      <link href="../../JqueryUI/themes/base/ui.all.css" rel="stylesheet" type="text/css" />
  14:      <link href="../../JqueryUI/themes/redmond/jquery-ui-1.7.1.custom.css" rel="stylesheet" type="text/css" />
  15:       <script type="text/javascript"  src='<%=ResolveUrl("../Scripts/jQuery/jquery-1.3.2.min.js")%>'>  </script>
  16:       <script type="text/javascript"  src='<%=ResolveUrl("../Scripts/slide.js")%>'> </script>
  17:       <script type="text/javascript" src='<%=ResolveUrl("../../JqueryUI/ui/ui_demos.js")%>'></script>
  18:      <link href="../_assets/css/jquery.notice.css" rel="stylesheet" type="text/css" />
  19:       <script type="text/javascript" src='<%=ResolveUrl("../Scripts/jQuery/jquery.notice.js")%>'></script>
  20:       <script type="text/javascript" charset="utf-8">
  21:           $(document).ready(function() {
  22:               //Page Flip on hover
  23:               $("#pageflip").hover(function() {
  24:                   $("#pageflip img , .msg_block").stop()
  25:              .animate({
  26:                  width: '307px',
  27:                  height: '319px'
  28:              }, 500);
  29:               }, function() {
  30:                   $("#pageflip img").stop()
  31:              .animate({
  32:                  width: '50px',
  33:                  height: '52px'
  34:              }, 220);
  35:                   $(".msg_block").stop()
  36:              .animate({
  37:                  width: '50px',
  38:                  height: '50px'
  39:              }, 200);
  40:               });
  41:           });
  42:  </script>
  43:      
  44:      
  45:      <script type="text/javascript" src='<%=ResolveUrl("../Scripts/jQuery/jquery.lazyload.mini.js")%>'></script>
  46:      <script src="../Scripts/jQuery/jquery-1.2.6-vsdoc.js" type="text/javascript"></script>  
  47:       <script type="text/javascript" charset="utf-8">
  48:           $(function() {              
  49:               $("img").lazyload({ threshold: 200 });
  50:           });
  51:           
  52:    </script> 
  53:   <script type="text/javascript" src='<%=ResolveUrl("../Scripts/mint.js")%>'></script> 
  54:   <script type="text/javascript" src='<%=ResolveUrl("../Scripts/ui.core.js")%>'></script>
  55:   <script type="text/javascript" src='<%=ResolveUrl("../Scripts/ui.notificationmsg.js")%>'></script> 
  56:  <%-- <script type="text/javascript" src='<%=ResolveUrl("../Scripts/firebug-lite-compressed.js")%>'></script>--%>
  57:   
  58:        <script type="text/javascript">
  59:            $(document).ready(function() {
  60:   
  61:                $('#msg1').notificationmsg({ period: 2500 });
  62:                $('#btnfade').click(onClick);
  63:                $('#btnslide').click(onClick);
  64:                $('#btnslidethru').click(onClick);
  65:                $('#closebutton').click(function() { $('#msg1').notificationmsg('hide'); });
  66:                Center();
  67:                function onClick(e) {
  68:                    debugger;
  69:                    var animStyle = 'slide'
  70:                    if (e.srcElement) {
  71:                        if (e.srcElement.id === 'btnfade') {
  72:                            animStyle = 'fade';
  73:                        }
  74:                        else if (e.srcElement.id === 'btnslide') {
  75:                            animStyle = 'slide';
  76:                        }
  77:                        else {
  78:                            animStyle = 'slidethru';
  79:                        }
  80:                    }
  81:                    else {
  82:                        if (e.target.id === 'btnfade') {
  83:                            animStyle = 'fade';
  84:                        }
  85:                        else if (e.target.id === 'btnslide') {
  86:                            animStyle = 'slide';
  87:                        }
  88:                        else {
  89:                            animStyle = 'slidethru';
  90:                        }
  91:                    }
  92:                    $.ajax({
  93:                        type: "POST",
  94:                        url: "http://localhost/onactiond/Default.aspx/GetMessages",
  95:                        data: "{}",
  96:                        contentType: "application/json; charset=utf-8",
  97:                        dataType: "json",
  98:                        success: function(msg) {
  99:                            debugger;
 100:                            $("#modalbody").text("(" + msg.d + ")");
 101:                            $('#msg1').notificationmsg({ animation: animStyle });
 102:                            $('#msg1').notificationmsg('show');
 103:                        },
 104:                        error: function(xhr, msg, e) {
 105:                            debugger;
 106:                            alert(msg);
 107:                        }
 108:                    });
 109:                }
 110:                function Center() {
 111:                    var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;
 112:                    var height = document.documentElement.clientHeight + document.documentElement.scrollTop;
 113:   
 114:                    var top = ((height + document.documentElement.scrollTop) / 2) - ($('#centerdiv').height() / 2) + "px";
 115:   
 116:                    var left = (width / 2) - ($('#centerdiv').width() / 2) + "px";
 117:                    $('#centerdiv').css({ position: "absolute", top: top, left: left });
 118:                }
 119:   
 120:                $('button.add').click(function() {
 121:                    var abdd = '';
 122:                    $.ajax({
 123:                        type: "POST",
 124:                        url: "http://localhost/onactiond/Simple.aspx/GetTime",
 125:                        data: "{}",
 126:                        contentType: "application/json; charset=utf-8",
 127:                        dataType: "json",
 128:                        success: function(msg) {
 129:                            //$("#ya").attr("value", msg.d);
 130:                            jQuery.noticeAdd({
 131:                                text: msg.d,
 132:                                stay: true
 133:                            });
 134:                        }
 135:                    });
 136:                });
 137:   
 138:                $('button.add2').click(function() {
 139:                    jQuery.noticeAdd({
 140:                        text: 'This is a notification that does not stay',
 141:                        stay: false
 142:                    });
 143:                });
 144:   
 145:                $('button.remove').click(function() {
 146:                    jQuery.noticeRemove($('.notice-item-wrapper'), 400);
 147:                });
 148:   
 149:            }); 
 150:      </script>
 151:      
 152:  <style type="text/css"> 
 153:  img { behavior: url(iepngfix.htc) }
 154:  #pageflip {
 155:      position: relative;
 156:      right: 0; top: 0;
 157:      float: right; 
 158:  }
 159:  #pageflip img {
 160:      width: 50px; height: 52px;
 161:      z-index: 99;
 162:      position: absolute;
 163:      right: 0; top: 0;
 164:      -ms-interpolation-mode: bicubic;
 165:  }
 166:   
 167:  #pageflip .msg_block {
 168:      width: 50px; height: 50px;
 169:      overflow: hidden;
 170:      position: absolute;
 171:      right: 0; top: 0;
 172:         
 173:  background-color:Gray;
 174:   background-image : url(../AppImage/icon-woman.gif);
 175:  }
 176:   
 177:  </style> 
 178:          <asp:ContentPlaceHolder id="head" runat="server"> 
 179:          </asp:ContentPlaceHolder>
 180:          
 181:  </head>
 182:      
 183:   
 184:      <%-- <script type="text/javascript"  language="javascript" >
 185:       $(document).ready(function()
 186:        {
 187:           $("a[href$='.pdf']").before("<img src='../_assets/img/icon_pdf.gif'/>");
 188:         })
 189:       </script>--%>
 190:  <body>
 191:   <img src='<%=ResolveUrl("tracker.aspx")%>'  width="1px" height="1px" alt=""/>
 192:   
 193:      <form id="form1" runat="server">
 194:     <div>
 195:          <div  style="width:100%";> 
 196:      <div id="pageflip"> 
 197:          <a><img src='<%=ResolveUrl("../_assets/img/page_flip.png")%>' alt="" /></a>
 198:          <div class="msg_block"></div> 
 199:      </div> 
 200:      </div>
 201:        <UC:Login runat="server" id="uclogin"></UC:Login> 
 202:       <div>
 203:              <div id="centerdiv" style="display:inline; text-align:center">
 204:                  <input id="btnfade" type="button" value="Get Messages [Fade]" /><br />
 205:                  <input id="btnslide" type="button" value="Get Messages [Slide]" /><br />
 206:                  <input id="btnslidethru" type="button" value="Get Messages [SlideThru]" />
 207:              </div>
 208:              <div id="msg1">
 209:                  <div id="modal">
 210:                      <div class="modaltop">
 211:                          <div class="modaltitle">My Inbox</div>
 212:                          <span id="closebutton" style="CURSOR: hand">
 213:                              <img alt="Hide Popup" src="styles/img/close_vista.gif" border="0" />
 214:                          </span>
 215:                      </div>
 216:                      <div class="modalbody">
 217:                          You received <strong><span id="modalbody"></span></strong>&nbsp;Email(s).
 218:                      </div>
 219:                  </div>
 220:              </div>
 221:          </div>      
 222:          <asp:ContentPlaceHolder id="ContentPlaceHolder1"  runat="server">     
 223:          </asp:ContentPlaceHolder>
 224:           <p class="clearfix"> 
 225:                  <button class="add">Add sticky notice</button> 
 226:                  <button class="add2">Add normal notice</button> 
 227:                  <button class="remove">Revome all notices</button> 
 228:              </p> 
 229:           <asp:ContentPlaceHolder id="ContentPlaceHolderFooter" runat="server">
 230:          </asp:ContentPlaceHolder>
 231:      </div>
 232:      </form> 
 233:  </body> 
 234:  </html>

Thursday, June 11, 2009

Simple Jquery Ajax : Server side Autocomplete and Server side data fetching


Simple way of using the jquery ajax is here.
I tried to make use the [webMethod] calls of Jquery ajax on the same aspx page and to fetch the database data.
In this article will learn:
Here you will find simple solutions on
1. How to use jquery
2. How to use Jquery ajax.
3. How to use jquery to call server side method.
4. How to use Jqeury ajax to call aspx methods and update the controls on the page.
5. Learn Autocomplete implementation and Server side data fetching (even from database)
without any postback.


Source code below.


1. ASPX code
   1:  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Simple.aspx.cs" Inherits="Simple" %>
   2:   
   3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   4:   
   5:  <html xmlns="http://www.w3.org/1999/xhtml">
   6:  <head runat="server">
   7:      <title></title>
   8:       
   9:      <link href="Common/_assets/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
  10:      <link href="Common/_assets/css/MyMessage.css" rel="stylesheet" type="text/css" />
  11:      <script src="Common/Scripts/jQuery/jquery-1.3.2.min.js" type="text/javascript"></script>
  12:      <script src="Common/Scripts/jQuery/jquery.autocomplete.js" type="text/javascript"></script>
  13:     
  14:      <script language="javascript" type="text/javascript">
  15:          var data = "";
  16:          $(document).ready(function() {             
  17:              $("#Result").click(function() {
  18:                  $.ajax({
  19:                      type: "POST",
  20:                      url: "Simple.aspx/GetTime",
  21:                      data: "{}",
  22:                      contentType: "application/json; charset=utf-8",
  23:                      dataType: "json",
  24:                      success: function(msg) {                             
  25:                              $("#ya").attr("value", msg.d);                        
  26:                      }
  27:                  });
  28:              });
  29:   
  30:            
  31:              $.ajax({
  32:                  type: "POST",
  33:                  url: "Simple.aspx/LoadData",
  34:                  data: "{}",
  35:                  contentType: "application/json; charset=utf-8",
  36:                  dataType: "json",
  37:                  success: function(msg) {
  38:                      data = msg.d.split(" ");
  39:                      $("#ya").autocomplete(data);
  40:                  }
  41:              });
  42:          }); 
  43:      </script>     
  44:  </head>
  45:  <body>
  46:      <form id="form1" autocomplete="true" runat="server">
  47:      <asp:ScriptManager ID="ScriptManager1" runat="server">
  48:      </asp:ScriptManager>
  49:      <div>
  50:      Autocomplete text box : type a,b,c<input type="text" style="width:300px;" name="searchQuery"   id="ya" />
  51:      <input type="button" id="Result"  value="Get Server time now " name="Result"/>    
  52:      <asp:Label runat="server" ID="lblinfo" ></asp:Label>    
  53:      <div visible="false">
  54:      </div>
  55:      </div>
  56:      </form>
  57:  </body>
  58:  </html>



2 ASPX.CS Code
   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.Linq;
   4:  using System.Web;
   5:  using System.Web.UI;
   6:  using System.Web.UI.WebControls;
   7:   
   8:  public partial class Simple : System.Web.UI.Page
   9:  {
  10:      protected void Page_Load(object sender, EventArgs e)
  11:      {
  12:      }
  13:   
  14:      [System.Web.Services.WebMethod]
  15:      public static string GetTime()
  16:      {
  17:          return DateTime.Now.ToString();
  18:          //this.lblinfo.Text = "";
  19:      }
  20:   
  21:      #region "AutoComplete"
  22:      [System.Web.Services.WebMethod]
  23:      public static string LoadData()
  24:      {
  25:          // this function can fetch data from database
  26:          return  "Aeroplane Apple Ambulance Border Crops Desalination Elephants  Parrot ";
  27:      }
  28:      #endregion
  29:   
  30:  }


Screen shot and code is straight forward. if you problem to understand, I will be glad to help.

Other Problems and solutions.
If any issues with Firefox for autocomplete
just make

<form id="form1" autocomplete="true" runat="server">


Thursday, June 4, 2009

Web.config Intelligence.

I had very difficult time to config the application in VS 2008 in web.config file.

Problem was intelligence was not working in web.config. Thanks to ScottGu's blog article...

It is simple... Replace

by

in web.config. Simple.

Wednesday, June 3, 2009

Know user is using mobile or computer browers


Asp.net c#,VB

HttpContext.Current.Request.Browser.IsMobileDevice

user client ip address in asp.net

Simple way to get the remote user ip address is

HttpContext.Current.Request.UserHostAddress

this can be used for user tracking details, again there are other variables like saving the
browser, version of it and many more details.


Tuesday, June 2, 2009

mssql how to get inserted record id

When you have a table which has a primary key (int) which is auto-incremented column, and
when you have to get the latest row id which is inserted into the table, then this query will give the solution.
This query will return, the latest record inserted detail.


select IDENT_CURRENT('table_name')

Asp.net : Getting Client ID


1. Javascript
document.getElementById("<%=txtbox1.ClientID %>");

2. Jquery
$("#'<%=txtbox1.ClientID %>'");


3. jquery- another approach
$("[id$='_txtbox1']");