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

ASP.NET

 
AnswerRe: A login problem Pin
C#Coudou31-Mar-11 21:02
C#Coudou31-Mar-11 21:02 
GeneralRe: A login problem Pin
Farhad Eft31-Mar-11 21:23
Farhad Eft31-Mar-11 21:23 
GeneralRe: A login problem Pin
Farhad Eft31-Mar-11 21:26
Farhad Eft31-Mar-11 21:26 
GeneralRe: A login problem Pin
C#Coudou3-Apr-11 22:13
C#Coudou3-Apr-11 22:13 
AnswerRe: A login problem [modified] Pin
davidnz2-Apr-11 10:57
davidnz2-Apr-11 10:57 
AnswerRe: A login problem Pin
SamRST4-Apr-11 21:19
SamRST4-Apr-11 21:19 
QuestionProblem with a require input field DropDownList if old records have null in this field Pin
kbalias31-Mar-11 20:42
kbalias31-Mar-11 20:42 
AnswerRe: Problem with a require input field DropDownList if old records have null in this field Pin
ktrrzn5-Apr-11 15:39
ktrrzn5-Apr-11 15:39 
Hi Kobus,

I suggest this solution:

use javascript to check ur default value b4 post it to server.

<script type="text/javascript">

var sDropDownList_HP = '<%=DropDownList_HP.ClientID %>';
// var slblMsg = '<%=lblMsg.ClientID %>';

function validateHospitalDropDownList()
{
   var ddlHP = document.getElementById(sDropDownList_HP);
   if(ddlHp.selectedIndex<1){
     // document.getElementById(slblMsg).innerHTML= "Please select Hospital";
     return false;
   }
   else{
     return true;
   }

}
</script>


In your asp code: there may be some button click event to post back to server:
I assume u have that button,

<asp:Button ID="Button1" runat="server" OnClientClick="if(!validateHospitalDropDownList())return false;"  Text="Submit" />


then add attribute OnClientClick and assign JS function to it, if this function return true, the form will post back
normally, else no post back will occur. you can also add some code to show error msg in the JS function.

Hint: in Data Null case, u can use ISNULL('value that can be null', 'new replace value'); function from SQL.

Hope that works!
QuestionHelp how to get the list of printer in the client computer Pin
C#Coudou31-Mar-11 15:17
C#Coudou31-Mar-11 15:17 
AnswerRe: Help how to get the list of printer in the client computer Pin
Not Active31-Mar-11 16:59
mentorNot Active31-Mar-11 16:59 
GeneralRe: Help how to get the list of printer in the client computer Pin
C#Coudou31-Mar-11 18:07
C#Coudou31-Mar-11 18:07 
GeneralRe: Help how to get the list of printer in the client computer Pin
Not Active1-Apr-11 0:59
mentorNot Active1-Apr-11 0:59 
Questiondocument.getElementById Not work With Masterpage ASP.Net VB Pin
Diyaa Hamza31-Mar-11 10:02
Diyaa Hamza31-Mar-11 10:02 
AnswerRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
El_Programmer31-Mar-11 10:53
El_Programmer31-Mar-11 10:53 
GeneralRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
Diyaa Hamza31-Mar-11 11:01
Diyaa Hamza31-Mar-11 11:01 
GeneralRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
El_Programmer31-Mar-11 11:11
El_Programmer31-Mar-11 11:11 
GeneralRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
Not Active31-Mar-11 11:54
mentorNot Active31-Mar-11 11:54 
GeneralRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
El_Programmer31-Mar-11 12:01
El_Programmer31-Mar-11 12:01 
GeneralRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
Not Active31-Mar-11 12:05
mentorNot Active31-Mar-11 12:05 
GeneralRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
Not Active31-Mar-11 12:01
mentorNot Active31-Mar-11 12:01 
GeneralRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
Diyaa Hamza31-Mar-11 12:34
Diyaa Hamza31-Mar-11 12:34 
GeneralRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
Not Active31-Mar-11 13:26
mentorNot Active31-Mar-11 13:26 
GeneralRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
ktrrzn5-Apr-11 15:51
ktrrzn5-Apr-11 15:51 
AnswerRe: document.getElementById Not work With Masterpage ASP.Net VB Pin
GenJerDan31-Mar-11 17:27
GenJerDan31-Mar-11 17:27 
QuestionHelp with regular expression for reg ex validator Pin
TimWallace31-Mar-11 7:50
TimWallace31-Mar-11 7:50 

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.