LIKE US ON FACE BOOK

Wednesday, 24 April 2013

Adding Custom Error Page to Asp.net Project

Hi Friends,

Please do follow these steps for Adding Custom Error Page.

>
     Create a error Page for eg:- error.aspx

>
     add entry to app setting ,if you have
     like this  
          
    <add key="Errorpage" value="/errorpage.aspx"/>

>  add entry to appsecurity,if you have 
    ike this 

   <page name ="error page" url="/projectname/errorpage.aspx">

      define any access rule or httpget or httpost 

  </page> 

>
   Main thing is make entry in web.config as below
  
  <configuaration> 
         <system.web>  
                       <customerrors mode="On" defaultRedirect="/error.aspx"/>
        </system.web>
  </configuaration>
   
Any doubts please do ask.

Tuesday, 16 April 2013

Comparing With RegEx and Adding Contents of Textbox to ASP ListBox Using JQuery




function Compare&Add() {      

            var regex = /^Your Regular Expression$/;          
            var str = $("[id$='textboxid']").val();
               var options = $("[id$='listboxid'] option");
            var alreadyexist = false;
           $("[id$='_promtlabel']").hide();
          if (str.match(regex)) {
              $(options).each(function () {
                  if ($(this).val() == str) {
                       $("[id$='_promtlabel']").show();
                      alreadyexist = true;
                      return;
                   }
              })
               if (!alreadyexist) {
                  $("[id$='listboxid']").append($("<option value = " + str + ">" + str + "</option>"));
                   $("[id$='textboxid']").val('');
                   return false;
              }          

        }

Here is Simple Code by using JQuery,Pushing up the Textbox value to Listbox in Asp.Net

If Any Doubts Please Comment...

Wednesday, 10 April 2013

Writing C# Code in JavaScript & Using Window.Location.href to reload Page in Javascript

Guys Here is Simplest Code ,I wrote it for my Work.


file.aspx:-

<input type="button" class="button" id="btncancle" onclick="javascript:cancle()"/>

Here is Java Script Used:--

function cancle(){
     window.location.href="Notification.aspx?ID=<%=base.WebsiteID%>";
}

Here <%=base.WebsiteID%>" is C# code called into javascript


Any Doubts Please do ask,Thanks Guys