|
Hi all,
I am registering one student so its corrosponding id is getting generated. i want to display this id in message box and redirect to another page , but i am not able to display alert box or message box because before displaying message i am redirecting to another page. how to solve this problem.
Thanks,
Amit Patel
|
|
|
|
|
Are you using alert and location.window.href in the same javascript function? If yes it should work, because as far as I know is alert blocking... Could you post a bit of the code, for a better understanding?
Regards
Sebastian
|
|
|
|
|
Hi,
<
string script = "<script language='javascript'>";
script += "alert('" + patientId + "');\n";
script += "</script>";
RegisterStartupScript("StartUp", script);
Response.Redirect("NewAppointment.aspx");>
Because of this Page is redirecting to another page and pop up is not coming
Regards,
Amit patel
|
|
|
|
|
In that case, you shouldn't use Response.Redirect on the server. Do the redirect within your script:
...
script += "window.location.href='http://Myserver/Myclient/NewAppointment.aspx';";
...
Regards
Sebastian
|
|
|
|
|
if you can do this with javascript then
you can use alert box like this alert(pass the value of generated id value)
and then redirect to next page.
|
|
|
|
|
Lol, thanks again for repeating the answer. Saying something twice is better than once
|
|
|
|
|
Page.RegisterClientScriptBlock("redirect", "<script>alert('You will be redirected in anoher page!'); window.location='default2.aspx';</script>");
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi ,
Thanks all
Page.RegisterClientScriptBlock("redirect", "<script>alert('You will be redirected in anoher page!'); window.location='default2.aspx';</script>");
This code is working fine
Thanks blue boy
|
|
|
|
|
You are welcome.
I Love T-SQL www.aktualiteti.com
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
hi all
i have master page and the content page, in my content page i show some product details in the gridview.there will be more product in the future, so i need to do is show some of product time to time without refresh the page (Asynchronously), i tried with using XMLHttpRequest request but how can set the timeout period for that, it should change details each 1 min in the page.
Pls help me to do this, What is the best way to do this
Thanks
|
|
|
|
|
|
hi
is there any control to do that in ajax, becous i want refresh those product details without any interact(without any user click any button).its should change the content automatically.
Pls reply to me this bit urgent.
Thanks
|
|
|
|
|
indSoftware wrote: is there any control to do that in ajax, becous i want refresh those product details without any interact(without any user click any button).
Yes !
Ajax Timer Control and Update Panel.
Have a look on my reply for details !
|
|
|
|
|
hii
Yes that right, this is working. thankss very much.
by the way cant we do that usign XMLHttpRequest, becous i think its light weight to the page also,this is just have a idea.
Thanks again
|
|
|
|
|
indSoftware wrote: by the way cant we do that usign XMLHttpRequest
Yes, That because AJAX is all about XMLHttpRequest
|
|
|
|
|
but scriptmanager holdd lots of resource of particular page,
what i mean using XmlHttpRequest is i tried with small javascript function create object of XmlHttpRequest and execute the page like that, but my problem is i couldn't give interval time to execute again that page.
|
|
|
|
|
You could quite easily do it using a javascript timer to control requesting every minute.
|
|
|
|
|
Explore UpdatePanel and Timer controls of Ajax and that will do your trick.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
hii
first of all i thank you very much for ur consider, yes this is wht i need.
but i hope to show some sliding way like using javascript when changing my content, i think i cant do that since im using this thanks again freind
|
|
|
|
|
I am agree what Blue_Boy suggested. You have to use AjaX Update Panel and TimerControl.
Bellow if the codesnippet, where I am updating the lblComments Value after a specific time
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer_Tick">
</asp:Timer>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" />
</Triggers>
<ContentTemplate>
<asp:Label ID="lblComments" runat="server"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
In the code behind
protected void Timer_Tick(object sender, EventArgs e)
{
// Set the label content data.
}
|
|
|
|
|
Good example to get clue for him/her.
Steps will be:
1 GridView inside UpdatePanel
2 TimerControl interval = 1minute
3 In Tick event of Timer bind GridView with select statement which is ordered by column's desceding
That's all.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
|
What are you trying to say?!
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Blue_Boy wrote: What are you trying to say?
Ohh..Sorry !! I was just asking to the person who vote your message as 1, though all of your points was valid .
|
|
|
|
|
Abhijit Jana wrote: who vote your message as 1
I'm glad that I can help to someone.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|