Tag: asp.net

8 is not less than or equal to 30?

Alright, I’ve got a RangeValidator: <asp:RangeValidator ID=”DateRangeValidator” runat=”server” ControlToValidate=”DateRange” ErrorMessage=”The date range must be at least 1 day, not more than 30, and neither date can be greater than today’s date.” EnableClientScript=”true” MinimumValue=”1″ MaximumValue=”30″ CssClass=”errortext span9 offset2″ Display=”Dynamic” /> And as you can see the minimum is 1 and the maximum is 30. That is […]

How to open a page in a new tab in the rowcommand event of gridview?

I have the following code : protected void gv_inbox_RowCommand(object sender, GridViewCommandEventArgs e) { int index = Convert.ToInt32(e.CommandArgument); if (e.CommandName == “sign”) { Session[“TransYear”] = int.Parse(((HiddenField)gv_inbox.Rows[index].Cells[1].FindControl(“HDN_TransYear”)).Value); Session[“MailNumber”] = int.Parse(((HiddenField)gv_inbox.Rows[index].Cells[1].FindControl(“HDN_MailNumber”)).Value); Response.Redirect(“Signature.aspx”, false); //Response.Write(“<script>”); //Response.Write(“window.open(‘Signature.aspx’,’_blank’)”); //Response.Write(“</script>”); } } I want to open the page in a new tab or window . The commented code do that but when […]

Call C# Function From JavaScript/JQuery In Asp.net webforms

So, i have an aspx page which looks like this: <%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs” Inherits=”_Default” %> <!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”> <div> </div> </form> </body> </html> I would like to know, how I can write JavaScript (e.g. jQuery) code that will […]

change active item in a card layout. ExtJS

I have a panel using the card layout as follows: var cardpanel = new Ext.Panel( { id: ‘cardPanel’, //title: ‘Card Layout’, region: ‘center’, layout: ‘card’, activeItem: 0, autoDestroy: false, bodyStyle: ‘border-top:0px’, defaults: { border: false }, items: [mediaGrid, mappanel], tbar: [ { id: ‘card-media’, text: ‘Media’, icon: ‘/img/silk/images.png’, width: 50, handler: function () { //switch […]

ASP.Net PostbackURL doesn't work if I put in Javascript Validation

I have a usercontrol in ASP.Net featuring a button that I use to postback. This button also has some Javascript validation that is done before it processes the event. Today I tried to postback to another URL by setting the PostBackURL property of the button. But it didn’t work and the page kept posting back […]

How to hide a validator's error text when the validator is initially enabled

I’ve got the following javascript code, which enables a bunch of validators. ValidatorEnable(document.getElementById(“<%=AddressValidator.ClientID %>”), true); ValidatorEnable(document.getElementById(“<%=CityValidator.ClientID %>”), true); ValidatorEnable(document.getElementById(“<%=CountryValidator.ClientID %>”), true); My problem is that when the validators are enabled with the above code, the error message (i.e. the validation text) is displayed. How can I hide the error message just for this instance when […]

How to manually submit a button in asp.net using javascript?

Using javascript, I want to submit a asp.net button, how can I do this? I know the onclick looks like: javascript:WebForm_DoPostBackWithOptions(new …..); I am also weary because the ID of the control can change.

Javascript error : Message: Expected ')'

I am getting a javascript error below, but I can’t seem to find the problem: *Message: Expected ‘)’ Line: 431 Char: 220 Code: 0 URI: http://mywebsite/CustomerLogin.aspx* Line 431 is this javascript line: <script language=’Javascript’> var varDateNow = new Date(); var varTimeNow = varDateNow.getTime(); var varAlertTime = document.getElementById(‘cphTopContent_AlertTime’).value; if(varTimeNow – varAlertTime < 1500) {alert(‘2’ values you […]

Why does a checkbox remain checked in FF3 but not in IE, Chrome or

So – I have a checkbox <asp:CheckBox ID=”chkOrder” runat=”server” Visible='<%#IsCheckBoxVisible() %>’ Checked=”false” OnCheckedChanged=”chkOrder_CheckedChanged” AutoPostBack=”true” EnableViewState=”false”></asp:CheckBox> the one above. Now, the checkbox is in a gridview and on databound – for all the rows in the gridview the checkbox is set to false. The problem is that the first checkbox is still true checked. In IE […]

JavaScript code to refresh page and or telerik grid

I need some kind of code which will refresh the page every 5min and if not the page then just the Telerik grid displayed on it since that’s all that’s rly needed. Only other thing would be if it was after 5min of no activity on the page if possible but it’s not core feature.