Friday, July 6, 2012

Change anchor tag text with jquery

To change the text with jquery simply use this syntax

 $('document').ready(function () {
        $('.txtText').click(function () {
                     alert($(this).text() ); //this will dispaly current text

                     $(this).text('new text ');//this will set new text


         });
    });

How to know your jquery version

To check your jquery version just alert this message.

alert($.fn.jquery);

and you will see your jquery version



Sunday, July 1, 2012

how to pass multiple values in commandargument

 ShowHeader="false">
    
        
          
       
 
 
 
protected void gridview_RowCommand(object sender, GridViewCommandEventArgs e)
{
      string[] arg = new string[2];
      arg = e.CommandArgument.ToString().Split(';');
      Session["IdTemplate"] = arg[0];
      Session["IdEntity"] = arg[1];
      Response.Redirect("Samplepage.aspx");
}
 

Monday, April 2, 2012

get value of a column on dataitembound event of datalist

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
HtmlAnchor anchorCountry = (HtmlAnchor)e.Item.FindControl("anchrCountry");
string code=DataBinder.Eval(e.Item.DataItem, "code");
if (code == "US" || code == "CA")
{
anchorCountry.HRef = "state.aspx";
}
else
{
anchorCountry.HRef = "city.aspx";
}

}

Wednesday, March 21, 2012

jquery validation

http://www.position-relative.net/creation/formValidator/demoValidators.html

Thursday, March 15, 2012

Saturday, March 10, 2012

validation control not working after OnClientClick added to button click event

actuallly i have to validate checkbox terms and conditions before submitting the form and to validate forms there is already server side validation controls are used. As there is validation controls not work on checkbox thats why i have written a javascript function to validate that checkbox but when i added the OnClientClick on that button , i checked that term and condition working perfectly but validation controls are not validating the forms. if i remove the onClientClick its works perfectly . finally with help of http://stackoverflow.com . i found the solution i have to explicitly call the validate function of server side validation controls and now my button html look like this :

OnClientClick="Page_ClientValidate(); IsChecked();" />

ASP.NET Core

 Certainly! Here are 10 advanced .NET Core interview questions covering various topics: 1. **ASP.NET Core Middleware Pipeline**: Explain the...