Click here to Skip to main content
15,884,237 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to pass & retrieve gridview as session variable. Pin
Ibrahim Bello1-Jun-09 9:29
Ibrahim Bello1-Jun-09 9:29 
GeneralRe: How to pass & retrieve gridview as session variable. Pin
Not Active1-Jun-09 9:36
mentorNot Active1-Jun-09 9:36 
GeneralRe: How to pass & retrieve gridview as session variable. Pin
Ibrahim Bello1-Jun-09 21:36
Ibrahim Bello1-Jun-09 21:36 
QuestionGridView Editing with VB.NET Pin
MacIntyre1-Jun-09 6:47
MacIntyre1-Jun-09 6:47 
AnswerRe: GridView Editing with VB.NET Pin
ToddHileHoffer1-Jun-09 10:28
ToddHileHoffer1-Jun-09 10:28 
GeneralRe: GridView Editing with VB.NET Pin
MacIntyre1-Jun-09 11:03
MacIntyre1-Jun-09 11:03 
GeneralRe: GridView Editing with VB.NET Pin
ToddHileHoffer1-Jun-09 12:21
ToddHileHoffer1-Jun-09 12:21 
GeneralRe: GridView Editing with VB.NET Pin
MacIntyre1-Jun-09 12:57
MacIntyre1-Jun-09 12:57 
QuestionHow to create forum in asp.net Pin
Saiyed Alam1-Jun-09 6:11
Saiyed Alam1-Jun-09 6:11 
AnswerRe: How to create forum in asp.net Pin
Christian Graus1-Jun-09 11:32
protectorChristian Graus1-Jun-09 11:32 
Questionsql query Pin
jainiraj1-Jun-09 6:06
jainiraj1-Jun-09 6:06 
AnswerRe: sql query Pin
Not Active1-Jun-09 7:31
mentorNot Active1-Jun-09 7:31 
QuestionPassing an ID to an external .js file Pin
dwolver1-Jun-09 4:44
dwolver1-Jun-09 4:44 
Want to do clienside validation on a textbox control. This textbox can represent two data types depending on an associtate checkbox. So if checkbox is checked the validation should do (a) and if off do (b)

In the javascript funtion below I do a getElementForID("chkBox1")
However if I want this to be a global routine I don't know what the checkBox would be
and preferably I'd like to pass an Integer so I could do multiple validations on this control or others. The "Sender" parameter seems to be my textbox, So question is how do I setup the ClientValidationFuntion property of the validator to pass an integer?  

My custom validator is setup like this

<asp:CustomValidator ID="lsdCustomVal" ControlToValidate="txtBox1" runat="server"
                     ClientValidationFunction= "validateLSDControl"></asp:CustomValidator>


in my external js file I have >>

function validateLSDControl( sender, args)
{
      var expr1 = "[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9]";
      var expr2 = "[a-z]-[0-9][0-9][0-9]-[A-Z]/[0-9][0-9]";
      var x = document.getElementById(sender.controltovalidate);
      var chkbox = document.getElementById("chkBox1");
      var smsg = "";
      if (chkbox.checked) {
            var patt1 = new RegExp(expr, "g");
            smsg = "expr1 Invalid";
      }
      else {
            var patt1 = new RegExp(nts, "g");
            smsg = "expr2 Invalid";
      }
           
      var result = false;
      if (x != null) {
            var s = x.value;
            if (s.match(patt1))
            {
//                  alert("it worked");
                  result = true;                 
            }              
            else
                  alert(smsg);

      }
      args.isValid = result;
}
AnswerRe: Passing an ID to an external .js file Pin
RajeevKumarSharma1-Jun-09 23:19
RajeevKumarSharma1-Jun-09 23:19 
QuestionGridview in ASP.Net with C# [modified] Pin
mahichandu1-Jun-09 4:18
mahichandu1-Jun-09 4:18 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello1-Jun-09 9:24
Ibrahim Bello1-Jun-09 9:24 
QuestionRe: Gridview in ASP.Net with C# Pin
mahichandu1-Jun-09 9:40
mahichandu1-Jun-09 9:40 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello1-Jun-09 22:04
Ibrahim Bello1-Jun-09 22:04 
QuestionRe: Gridview in ASP.Net with C# Pin
mahichandu2-Jun-09 6:36
mahichandu2-Jun-09 6:36 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello2-Jun-09 7:03
Ibrahim Bello2-Jun-09 7:03 
QuestionRe: Gridview in ASP.Net with C# Pin
mahichandu2-Jun-09 7:19
mahichandu2-Jun-09 7:19 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello2-Jun-09 7:31
Ibrahim Bello2-Jun-09 7:31 
QuestionRe: Gridview in ASP.Net with C# Pin
mahichandu2-Jun-09 7:48
mahichandu2-Jun-09 7:48 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello2-Jun-09 8:09
Ibrahim Bello2-Jun-09 8:09 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello3-Jun-09 22:08
Ibrahim Bello3-Jun-09 22:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.