Hi,
I am new to Asp, but i've been succesfully following the Asp tutorials on this site to build some pages. Now i would like to use some client side script but i'm not sure how to get started. Can some one give me a clue? Specifically, I have some combo boxes that need to postback and i would like to do that on the client side instead instead of refreshing tha page. Is that possible? Where exactly is the code to be changed? Also using the default calendar controls in Visual Studio causes a postback. Is there a way to use the control to get the seleceted date without refreshing the page?
Thanks!
Aieman
hi Aieman,
Now i would like to use some client side script but i'm not sure how to get started
you have to learn javascript to start coding at client side. following URL will help u to start javascript.
http://www.echoecho.com/javascript.htm
Also using the default calendar controls in Visual Studio causes a postback. Is there a way to use the control to get the seleceted date without refreshing the page?
There are lots of javascript calender are available .......and with help of that you can select the date from client side calender and can easily put the selected date into particular textbox also. you can use one of the following ( or even all :) )
http://www.mattkruse.com/javascript/calendarpopup/
http://www.softcomplex.com/products/tigra_calendar/
http://www.dhtmlgoodies.com/scripts/js_calendar/js_calendar.html
Happy Programming
Best Regards,
Muhammad Akhtar Shiekh
Please remember to mark the appropriate replies as answer after your question is solved, thanks
Thank you.
I actually do have some knowledge of Javascript but in html pages. How do i do that in an Asp page? Is there something simple that i'm missing?
I also have another question. Will Ajax solve my problem? I looked at their basic tutorial and they have an update panel and some calendar controls. Are there any limitations with using Ajax? Can i integrate it into my already existing Aspx pages?
Kind regards,
Aieman
ah.............. lots of questions in single post........
but never mind
i will try to answer
I actually do have some knowledge of Javascript but in html pages. How do i do that in an Asp page? Is there something simple that i'm missing?
you can add the javascript on aspx page in the same way that u adopt in html page.....
e.g
function validateEmployeeSearchCriteria()
{
frm=document.form1;
if (frm.txtSearchEmpNo.value =="" )
{
window.alert("Employee Number is Empty");
frm.txtSearchEmpNo.focus();
return false;
}
else if (!frm.txtStudentNo.value =="" )
{
window.alert("Student Number is empty");
frm.txtStudentNo.focus();
return false;
}
return true;
}
Now if you want to activate this javascript on Button1 Client click..write this code on server side
Button1.Attributes.Add(
"onClick", "return validateEmployeeSearchCriteria();")Now Button1 will only postback to the server when this javascript return true.(mean after client side validation)
I also have another question. Will Ajax solve my problem? I looked at their basic tutorial and they have an update panel and some calendar controls. Are there any limitations with using Ajax? Can i integrate it into my already existing Aspx pages?
Offcours, Ajax will help you in many situations.....You can use Update Panel for partial rendering of your page......but remember ,,,,,,,page always postback in case of UpdatePanel ......but only updatepanel contents will be updated..........you can also use Ajax Calender control.......and that is totally javascript implemenration.......mean ur page doesn't postabck if you use Ajax Calender to pick date on client side......You can also integrate existing webapplication to AJAX enable application but configuration web.config .
http://ajax.asp.net/files/Migration_Guide_CTP_to_RC.aspx this article will help you in this regard
Hope you understand
Best Regards,
Muhammad Akhtar Shiekh
Please remember to mark the appropriate replies as answer after your question is solved, thanks
Hi
Thanks for your help...
Aieman