|
use
your c# functions.....
|
|
|
|
|
I already have my function on mypage.aspx.cs page. I want to call this on aspx page. so how can i do this
|
|
|
|
|
AJAX[^] is the answer. To make things easier, use AJAX toolkit for ASP.NET.
|
|
|
|
|
i'm not much aware about Ajax.Could you tellme the any other.I have my function in aspx.cs page I call this on aspx page
|
|
|
|
|
What the hell is wrong with you? You ask a question, you're given the de-facto answer and you want a different way of doing it just because you're not familiar. How do you think people learn new concepts?
|
|
|
|
|
I would prefer you to use AJAX but here is one other solution.
From javascript make a call to dopostback method with eventtarget and arguments (if reuqired) and in Page Load method check for the event target and call the C# method. Remember this is dirty trick.
JavaScript (JS File)
__doPostBack('CALL_MY_METHID','');
ASPX Code Behind
void Page_Load(object sender, EventArgs e)
{
....
....
this.GetPostBackEventReference(this, string.Empty);
string eventTarget = (this.Request["__EVENTTARGET"] == null) ? string.Empty : this.Request["__EVENTTARGET"];
if (eventTarget == "CALL_MY_METHID")
{
CallMyMethod();
return;
}
....
....
}
Be careful, there is no Undo Button(Ctrl+Z) in life.
|
|
|
|
|
.NET is parsed by the server. Javascript is parsed by the browser. If you have page that is already loaded that you want to process a .NET page, asking the server to do so via Javascript is the best way.
Ranjit Viswakumar
Professional Services Specialist
HostMySite.com[^]
|
|
|
|
|
If we are calling a server side function we can use a number of way.
I use mostly static PageMethods ([System.Web.Services.WebMethod]) using Ajax or HTTP Handlers. Can anyone please tell me which method is better and the pros and cons of each.
I keep performance and response time the first criteria.
Thanks.
|
|
|
|
|
Anurag Gandhi wrote: Ajax or HTTP Handlers
AJAX and HttpHandler has no relation. I am not sure what you meant.
|
|
|
|
|
We can call server side function by
1. writing a static function ([System.Web.Services.WebMethod]) in code behind using PageMethods.
2. calling an HTTP Handler and returning the string.
by using Ajax.
My Question is which method is faster. I want to know about the pros and cons of each.
|
|
|
|
|
I am still not getting you. HttpHanlder can't return a string. It sits in the page request pipeline and handles request.
|
|
|
|
|
An HttpHandler can definitely return a string...it just processes an http request and responds with something...doesn't have to be a full page. It does, however, incurr the cost of full ASP.NET pipeline processing, which combined with the effort to write one, makes them less appealing than a PageMethod.
|
|
|
|
|
PageMethods behave as web services, but offer a bit more capabilities than a web service. Unlike a full postback (i.e. UpdatePanel) which will incurr the overhead of processing the full ASP.NET pipeline, a PageMethod has a bit of a truncated pipeline that sets up the context, but bypasses all the rest of the event chain required for a full page postback. An HttpHandler is like a Page (in fact, a Page is an HttpHandler), and as such it will require the full event chain to be fired. A PageMethod is pretty much the most efficient way to perform an AJAX call that requires Session and HttpContext access, but not Request/Response access. A WebService might be faster, but there is SOAP overhead that could hurt performance.
Given that HttpHandlers and WebServices require a bit more work to write than a PageMethod, and the extra processing cost for both, PageMethods are generally the best solution when a full postback (async via UpdatePanel or not) is not needed.
|
|
|
|
|
Hi, I am new to HTML UI design. I am having a requirement similar to http://deluxe-tabs.com/templates/[^]
We needs to create tabs like Glass style, Vertical style, etc. For each tab, we needs to have its respective div tag.
Can you please suggest any good article, where I can learn the basics of the same?
Thanks
Jey
modified on Tuesday, February 3, 2009 5:06 AM
|
|
|
|
|
you need to learn javascript in order to achieve this functionality..
or ajax....
what you want to do??
you want to create your own or using existing one???
umerumerumer
|
|
|
|
|
Hi, Yes, I needs to create my own. I would like to understand the basics. Also kindly suggest any article where I can learn the basics. Thanks
Jey
|
|
|
|
|
|
Hi, I am aware of www.w3schools.com Umer. I need some basic examples for my requirement, from where I can start work on it...As a expert you can suggest some best examples. I hope you understand.
Jey
|
|
|
|
|
|
|
i have country and city dropdown list both in a update panel.
on selectedindex change of country i am population list of cities..
it is working fine in IE 7 but in IE 6 i tries to populate city list but take long time and after that i get error request time out same is the case with fire fox can any one guide where is the problem ???
umerumerumer
|
|
|
|
|
I know if you write your own AJAX code there's no reason for that to happen, but are those controls compatible with those browsers ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
use the break point and check where the error is coming.
|
|
|
|
|
no no i am not using any code of mine....
and break point is not concerned here i get javascrit error or ajax on status bar request time out...
only in case of firefox and ie6 in ie 7 every thing works fine i am just loading city list in dropdown nothing else.....
umerumerumer
|
|
|
|
|
or try in update panel there is content template and Triggers.
In Triggers,u set the <asp:autopostback id="YOURCONTROLID" xmlns:asp="#unknown">..
try it.
|
|
|
|