Click here to Skip to main content
15,887,267 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAzure and Web Controls Pin
#realJSOP12-Dec-09 4:15
mve#realJSOP12-Dec-09 4:15 
AnswerRe: Azure and Web Controls Pin
Oakman12-Dec-09 8:49
Oakman12-Dec-09 8:49 
AnswerRe: Azure and Web Controls Pin
Abhishek Sur12-Dec-09 9:57
professionalAbhishek Sur12-Dec-09 9:57 
QuestionPrinting in ASP.NET Pin
tunsten12-Dec-09 2:33
tunsten12-Dec-09 2:33 
AnswerRe: Printing in ASP.NET Pin
m-khansari12-Dec-09 3:40
m-khansari12-Dec-09 3:40 
GeneralRe: Printing in ASP.NET Pin
tunsten15-Dec-09 5:13
tunsten15-Dec-09 5:13 
GeneralRe: Printing in ASP.NET Pin
m-khansari15-Dec-09 23:02
m-khansari15-Dec-09 23:02 
QuestionGetting Server control Id with JavaScript code... Pin
tunsten12-Dec-09 2:03
tunsten12-Dec-09 2:03 
Hello everyone,

How do I get the ID of a server control with JavaScript code?

I am trying to do client-side validation with JavaScript before it's processed on the server, the code I used didn't work and I did't get error. Below is the code I used:



// the JavaScript function



function ValidateAssetCategory() {
var catID = document.getElementById("txtCatID").value;

if (catID == null) {
alert("Please enter category ID");
return false;
}
}

// the aspx source code

<asp:LinkButton ID="lbSave" runat="server" OnClientClick="ValidateAssetCategory();" onClick="lbSave_Click">Save</asp:LinkButton>

only the server code is executed.



Thanks for your understanding...

Tunsten

AnswerRe: Getting Server control Id with JavaScript code... Pin
Abhijit Jana12-Dec-09 2:13
professionalAbhijit Jana12-Dec-09 2:13 
GeneralRe: Getting Server control Id with JavaScript code... Pin
tunsten12-Dec-09 2:25
tunsten12-Dec-09 2:25 
AnswerRe: Getting Server control Id with JavaScript code... Pin
Iman Ebadi12-Dec-09 2:45
Iman Ebadi12-Dec-09 2:45 
GeneralRe: Getting Server control Id with JavaScript code... Pin
tunsten12-Dec-09 2:58
tunsten12-Dec-09 2:58 
AnswerRe: Getting Server control Id with JavaScript code... Pin
Abhishek Sur12-Dec-09 10:02
professionalAbhishek Sur12-Dec-09 10:02 
GeneralRe: Getting Server control Id with JavaScript code... Pin
tunsten15-Dec-09 5:07
tunsten15-Dec-09 5:07 
AnswerRe: Getting Server control Id with JavaScript code... Pin
m-khansari12-Dec-09 3:30
m-khansari12-Dec-09 3:30 
GeneralRe: Getting Server control Id with JavaScript code... Pin
tunsten15-Dec-09 5:05
tunsten15-Dec-09 5:05 
QuestionPopup from a GridView control... Pin
tunsten12-Dec-09 1:51
tunsten12-Dec-09 1:51 
AnswerRe: Popup from a GridView control... Pin
Abhijit Jana12-Dec-09 1:57
professionalAbhijit Jana12-Dec-09 1:57 
GeneralRe: Popup from a GridView control... Pin
tunsten12-Dec-09 2:14
tunsten12-Dec-09 2:14 
GeneralRe: Popup from a GridView control... Pin
Abhijit Jana12-Dec-09 2:21
professionalAbhijit Jana12-Dec-09 2:21 
GeneralRe: Popup from a GridView control... Pin
tunsten12-Dec-09 2:28
tunsten12-Dec-09 2:28 
QuestionSending mail from asp.net.. need help Pin
Hema Bairavan11-Dec-09 23:47
Hema Bairavan11-Dec-09 23:47 
AnswerRe: Sending mail from asp.net.. need help Pin
Abhijit Jana12-Dec-09 1:43
professionalAbhijit Jana12-Dec-09 1:43 
GeneralRe: Sending mail from asp.net.. need help Pin
farogh haider14-Dec-09 18:45
farogh haider14-Dec-09 18:45 
QuestionCrystal Report Pin
mylogics11-Dec-09 23:25
professionalmylogics11-Dec-09 23:25 

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.