|
You can use here a regular expression validator
The Developer - CEH
|
|
|
|
|
How can I check valid date format(dd/mm/yyyy) and get difference in number of days only between 2 dates using javascript function.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
|
ok,thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
I have a datagrid with a hyperlink column in it. in the hyperlink i want to send the ID from the grid and the value of the dropdawn list i have that i need to select from to show the grid. So i want to pass the ID and the selected value of the DDL in the link. Any Ideas how to do that?
Thanks
The Developer - CEH
|
|
|
|
|
Pass it as query string.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
it needed lots of work but finally it works
The Developer - CEH
|
|
|
|
|
Hie all. I have two forms frmmain and frmpopup(whis is a popup from frmmain). i want to force a postback on frmmain when a buton has been clicked on frmpopup. How do i go abt it.
|
|
|
|
|
Check the javascript that is used to do a postback, and call it yourself.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
|
yes, you can do it using java script. or call java script methods from server side.
Try to learn ProgressWindow Concept
window.opener.progressWindow
This will help you. Now try to do it your self. . if you have any issue the ask me.
cheers,
Abhijit
|
|
|
|
|
is there a refresh method for window.opener.location class.
the one below is reloading the whole page but i just want a postback
if (window.opener && !window.opener.closed)
{
window.opener.location.reload();
}
|
|
|
|
|
i used this: window.opener.progressWindow and it worked.
thank you very much
|
|
|
|
|
Hi i am using update panel in my page...,
When i click add button data is storing to my datatbase..,
After that i called one method, in that i said give alert msg in javascript...,
If i wont give update panel its giving that alert msg...,
If i use update panel its executing the script, but its not giving the alert msg,
How to solve this?,
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
how did you execute the script ? I think you are using Page.RegisterStartupScript to executing script.
Use This.
ScriptManager.RegisterStartupScript(this, this.GetType(), "myscript", "alert('Your Message');", true);
You have to use ScriptManager to register Client Script while using Ajax on the page.
Hope this helps you !!
cheers,
Abhijit
|
|
|
|
|
Ya ur correct i am using page.registerstartupscript only...,
This one i have used in my "cs" file...,
This cs file contained method i called in my aspx page...,
In that aspx page only i have used script manager...,
So now tell me where i want to use that code(ScriptManager.RegisterStartupScript)?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
New one wrote: So now tell me where i want to use that code(ScriptManager.RegisterStartupScript)?
the same place where you have written page.register....
insted of that use
ScriptManager.RegisterStartupScript(this, this.GetType(), "myscript", "JavaScriptMethod();", true);
Let me know if you have any issue .
cheers,
Abhijit
|
|
|
|
|
No still i didnt get u,
See this is my code in aspx.cs file:
if(_err==0)
{
Common.CreateMessageAlert(this,_errmsg);
clearall();
}
else
{
Common.CreateMessageAlert(this,_errmsg);
}
This _errmsg i am getting from my sql stored procedure,...
And this is my cs file:
public class Common
{
//-------------Rifaqat----------//
public static bool CreateMessageAlert(System.Web.UI.Page aspxPage,string strMessage)
{
string strScript= "<script language=JavaScript>alert( \""+strMessage+"\" )</script>";
if (! aspxPage.IsStartupScriptRegistered("strKey1") )
{
aspxPage.RegisterStartupScript("strKey1", strScript);
}
return false;
}
public Common()
{
//
// TODO: Add constructor logic here
//
}
Now plz tell me where i have to use
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
New one wrote: Common.CreateMessageAlert(this,_errmsg);
}
This _errmsg i am getting from my sql stored procedure,...
in Else Parth just Write
ScriptManager.RegisterStartupScript(this, this.GetType(), "myscript", "JavaScriptMethod();", true);
cheers,
Abhijit
|
|
|
|
|
No not at all working,
Plz understand my probs,
My javascript alert msg in one cs file...,
This cs file method i am calling in my aspx page...,
Like this:
Common.CreateMessageAlert(this,_errmsg);
Now this _errmsg passing as a parameter for my cs file
In cs file code is like this:
public static bool CreateMessageAlert(System.Web.UI.Page aspxPage,string strMessage)
//Here getting that _errmsg as strMessage
{
string strScript= "<script language=JavaScript>alert( \""+strMessage+"\" )</script>";
if (! aspxPage.IsStartupScriptRegistered("strKey1") )
{
aspxPage.RegisterStartupScript("strKey1", strScript);
}
return false;
}
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
New one wrote: This cs file method i am calling in my aspx page...,
what does it mean ?are you calling cs methods from aspx page ? or what ?
cheers,
Abhijit
|
|
|
|
|
S i am calling cs file methods in my aspx page...,
In aspx page my script manager is there and in my cs file method i declared like this:
string strScript= "<script language=JavaScript>alert( \""+strMessage+"\" )</script>";
if (! aspxPage.IsStartupScriptRegistered("strKey1") )
{
aspxPage.RegisterStartupScript("strKey1", strScript);
}
return false;
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
|
Confusing
I think you are doing something wrong while calling the javascript function.
make Sure that Javascript code can't run at server side you can only Register it or
It is going to run at client side(Browser will run).
New one wrote: This cs file method i am calling in my aspx page...,
Like this:
Common.CreateMessageAlert(this,_errmsg);
Now this _errmsg passing as a parameter for my cs file
This is making me confused
Can you tell me what are you trying to do
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
No guys i will tell u,
See in one cs file i declared a method it have to give alert msg where ever i will call...,
So the code is like this: and the cs file name is(common.cs)
public static bool CreateMessageAlert(System.Web.UI.Page aspxPage,string strMessage)
{
string strScript= "<script language=JavaScript>alert( \""+strMessage+"\" )</script>";
if (! aspxPage.IsStartupScriptRegistered("strKey1") )
{
aspxPage.RegisterStartupScript("strKey1", strScript);
}
return false;
}
Now in my aspx page after add a data to database i call this method to show data has been updated like...,
So my aspx.cs code will be look like this:
if(_err==0)
{
Common.CreateMessageAlert(this,"Saved");//Here i am calling that cs file method and passing msg text "Saved" has to display
clearall();
RefreshData();
}
else
{
Common.CreateMessageAlert(this,"Not Saved");
}
The method is excecuting here i checked in debug mode...,
But its not giving the alert msg before that msg alert its moving to clearall() method execution
Now u guys getting?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|