|
this is my function login
function login()<br />
{<br />
if(document.getElementById('TB_uname').value=="")<br />
{<br />
alert('Enter Your Username');<br />
return false;<br />
}<br />
}
Yeah.still It doesn't work.It doesn't give any error message.
thanks
|
|
|
|
|
Now i know what is your real problem you want to prevent the postback if the TB_uname is equal to empty string. the problem is in your onClientClick attribute you need to add "return".
OnClientClick="return OnClientClick="login();"
Change your login function to this code.
function login()
{
if(document.getElementById('TB_uname').value=="")
{
alert('Enter Your Username');
return false;
}
else
{
return true;
}
}
And Your Button
<asp:Button ID="BT_signin" runat="server" CssClass="text1" Height="24px" Text="Sign In" Width="52px" OnClick="BT_signin_Click" OnClientClick="return login();" />
Keep me updated...
Regards,
Mark
|
|
|
|
|
And tell me if you have a javascript error? if does it means the join.js is not yet visible to your page.
Keep me updated.
Regards,
Mark
|
|
|
|
|
If I write simple alert message then its fire.but when I write it in if condition then its not fired.
I think my texbox's id is not found in .js file.
|
|
|
|
|
Ok.
Happy coding.
Regards,
Mark
|
|
|
|
|
What ok? (
its not my solution. I want validate and still i am confuze how do I validate it?
Plz give me right solution
and thanks a lots 4 ur help
pathan
|
|
|
|
|
Hi Pathan,
Just read below. Hope this helps.
<asp:Content ID="Content1" ContentPlaceHolderID="CPHID" runat="Server">
<script language="javascript" src="join.js" type="text/javascript">
</script>
</asp:Content>
/*In Code Behind File, add the following code in Page_Load (if you are using an ASP button control)
Make sure that you have added script tag on top of your page.
the script tag should be added within '<asp:Content></asp:Content>' as you are using Master Pages
*/
Button1.Attributes.Add("OnClick","return CallMethod();");
//above statement will call javascript function written in the join.js
|
|
|
|
|
HI Harini.
Thanks 4 ur reply.
I have done it but its not working.
|
|
|
|
|
Hi ,
How to show only my posted Questions in this Forum under Asp.Net Category
becoz i am posted so many Questions,but i couldn't see the answers for my posted Questions due to many questions.
Also it will help reviewing answers after some days
Thank you
|
|
|
|
|
1. Click "Search Comments" beside the set option button.
2. type into Author Textbox "siddisagar"
3. choose "post only" into dropdownlist Search For.
4. click search.
Regards,
Mark
|
|
|
|
|
Hi Anthony thank you very much..
Keep Reply to my Queries
|
|
|
|
|
Here is another way to do.
You see "profile image" beside your user name. Click this image. then it will take you to your profile page.
Please find a link "Messages Posted" in your profile page.
Then, click that link. you will see all of your question in that pages.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Thank you.
|
|
|
|
|
Hi,
How to create aspx pages with top part of the page constant accross multiple pages. Is there anything like frames in asp.net or any other way of implementing this. I have some drop down lists and a button control, on top of multiple pages. Selection of the drop down list values and button click event should trigger a resulting page in the bottom part. Appreciate all the help
Raj D
Raj D
|
|
|
|
|
You can use IFrame or Frame.
- Go to Design View of Webpage.
- Change to HTML View.
then, you can manually type "IFrame" or "Frame" in your page.
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message. Thank you.
|
|
|
|
|
|
How about we make things simple - Masterpages.
As was pointed out ASP.NET simply renders to HTML and usually includes plenty of HTML tags on a page.
|
|
|
|
|
Hi,
When I try to install a starter kit, for example DotNetNuke or Commerce Starter kit from a .vsi file, I get the following error:
A problem occured while running the installer. Please contact the content auther for problems with the content.
Error message:
String cannot have zero length.
Please can someone tell me why this is the case? Have I deleted certain folders? I have never had this error before and I have installed other starter kits on my PC, but I deleted them manually a while ago. If there is problems with the installer, how can I/where can I re-install it?
I am using VS2005.
Regards
ma se
|
|
|
|
|
|
Probably a dumb question but hopefully someone can help me.
I just installed MS Enterprise Library to use Data Access Application Block. I can't seem to find the .dll file under "Add Reference" dialog box to make reference in my project.
I found the .dll under "C:\Program Files\Microsoft Enterprise Library January 2006\bin" folder but I am not sure if this is what I need to reference!
Should it not appear in the "Add Reference" dialog box?
Thanks in advance.
|
|
|
|
|
In the "Add Reference" dialog box there is a tab called "Browse", use that to navigate to the folder you mentioned. Usually this is the way you reference 'addons'.
|
|
|
|
|
Taurian110 wrote: Should it not appear in the "Add Reference" dialog box?
It does, but it is displayed as something odd. (But, it makes sense after a while)
Microsoft Patterns and Practices.... (I think)
Taurian110 wrote: I found the .dll under "C:\Program Files\Microsoft Enterprise Library January 2006\bin" folder but I am not sure if this is what I need to reference!
If you go browsing for it then that's the one.
|
|
|
|
|
The dll from assembly folder shows in "Add Reference" dialog. So, If you wanna see those dlls then you should add them into Assembly Folder. but made sure these dlls have strong key..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message. Thank you.
|
|
|
|
|
hello all,
i'm trying to change an sql command string by assigning a strSelected variable and injecting it into a WHERE clause, but it keeps coming up null:
<br />
public partial class _Default : System.Web.UI.Page <br />
{<br />
public string strSelected;<br />
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!Page.IsPostBack) <br />
strSelected = "*";<br />
<br />
String sConStr = "Provider=Microsoft.Jet.OLEDB.4.0;" +<br />
"Data Source=" + Server.MapPath ("ExcelData.xls") + ";" +<br />
"Extended Properties=Excel 8.0;";<br />
OleDbConnection objConn = new OleDbConnection (sConStr);<br />
objConn.Open ();<br />
<br />
OleDbCommand objCmdSelect = new OleDbCommand ("SELECT " + strSelected + " FROM myRange1", objConn);<br />
OleDbCommand objCmdSelectFirstname = new OleDbCommand ("SELECT Firstname FROM myRange1", objConn);<br />
OleDbCommand objCmdSelectLastname = new OleDbCommand ("SELECT Lastname FROM myRange1", objConn);<br />
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter ();<br />
objAdapter1.SelectCommand = objCmdSelect;<br />
DataSet objDataset1 = new DataSet ();<br />
objAdapter1.Fill (objDataset1, "XLData");<br />
GridView1.DataSource = objDataset1.Tables[0].DefaultView;<br />
GridView1.DataBind ();<br />
<br />
objConn.Close ();<br />
}<br />
<br />
protected void lbQuery_SelectedIndexChanged (object sender, EventArgs e) {<br />
switch (lbQuery.SelectedValue) {<br />
case "firstName":<br />
lblSelected.Text = "First name query selected.";<br />
strSelected = "Firstname";<br />
break;<br />
case "lastName":<br />
lblSelected.Text = "Last name query selected.";<br />
strSelected = "Lastname";<br />
break;<br />
case "entireRange":<br />
lblSelected.Text = "Entire range query selected.";<br />
strSelected = "*";<br />
break;<br />
default:<br />
lblSelected.Text = "Select query type above.";<br />
break;<br />
}<br />
}<br />
}
but whenenver i click on any of the items in the lbQuery listbox it seems like it reiterates to strSelected being null due to the declaration of the variable at the top. any pointers as to how to go about this?
thanks in advance,
M.
|
|
|
|
|
It doesnt look like you're ever doing anything with it after you set it to the column name. The button click event takes place after the Page_Load event so if you want to run that query again you need to place it inside it's own method and call it from both places respectively.
Cleako
|
|
|
|
|
Dear CPians,
I am using the Page.IsPostBack property. When this evaluates to true, hence I am within a post back, I want, in some cases to cancel the post back. I need to prevent it of happening in case some condition evaluates to true.
Example:
if (Page.IsPostBack)
{
if (something == true)
{
DO SOMETHING TO CANCEL THE POSTBACK
}
}
Is there a way to prevent it of happening?
Thanking you in advance
|
|
|
|