I am trying to use some page methods on an aspx page. I've done this several times before in other asp.net applications and never had issues until now. I believe that maybe the issue has something to do with the methods be exposed to POST but I'm not entirely sure. Everything on the page loads correctly then once it attempts to make an ajax call rather than hitting the "test" function, the page tries to reload and the page_load method is called again. I chacked the URL string on both cases when page_load is called and both are correct. I am suspicous that there is some need to do with the web.config but I'm not sure what. The application is close to 10 years old and has been grandfathered up all the way to ASP.net 3.5. On another note, I can hit asmx functions perfectly fine its only page methods that seem not to work.
Imports System.Web.Script.Services
Imports System.Web.Services
Partial Public Class CustomDataFilter[code].....
I found a write-up somewhere about the multi-handle slider control and in the post there were the following javascript lines:
slider.add_value(value); slider.add_drag(value);
Slider, in this case, is my slider control... but how did the person know these two methods exists? Is there an API guide somewhere for the Ajax Control Toolkit?
I have some of the methods in the master page,I want to inherit the master page to content page and use its methods...How will be able to do that..Do we have some techniques with inheritence?Please specify the techniques andPlease in C# with Code Behind...
I am trying to implement the webrequest get and post methods. I am accessing a secure site that requires login authentication and was told that instead of sending a login request all the time; login to the site and capture the cookie and use this to send it in the header to get results from the page. In other words let us use google for example. Lets say google required u to login before searching for something. Now I login through my browser and leave the site logged in. Now I send a httwebrequest from my program that includes the cookie authentication details in the request header and get results for say ?param=sports. Now when I increment the page number like &page=3, I am still only getting page 1 results.
Here is some code:
[Code]....
Now I am using the request method GET. This is in the actual request header from the original request.
I have to maintain an ASP.net application in VB.Net. There is a page with a FormView bound to a ObjectDataSource. I have to add some business logic on the ItemUpdating event of this FormView. Unfortunately, some the data that I need to add this business logic is not exposed on the FormView user-interface itself, so I can not use FindControl to get the values (I could add the controls, bind them to the fields I need and set their visible property to true, but that's ugly).
So, what I would need to do is to get access to the Data Row corresponding to the currently selected item in the FormView from the code behind as it has the data I need to add my business logic code. Unfortunately, I don't manage to get access to the row.
I couldn't think of a decent title, so let me first apologize for that. I have a WebService (call it A) written for my app so I can take advantage of ASP.NET 3.5 AJAX features. I use the generated JavaScript proxy to make AJAX calls.As a side effect, WebService A is exposed for anyone to add as a reference to another project, which is great, except I don't want certain WebMethods to be available to external applications (in the same domain, BTW).So I've got two questions:Is there a way to control the exposure of WebMethods in WebService A?
If there isn't, I'm thinking I'll just add a separate WebService (B) that exposes the WebMethods I need from WebService A. But then,How can I prevent other applications from referencing WebService A while still allowing the application it originates in to access it?If that's not possible, I'm not really worried about it. The apps are all intranet-only, I just don't want the WebServices to be abused.Also, there is a similar question here already without any good anwers. The asker describes almost the same situation I'm in: [URL]
I have created a webservice which is publicly exposed. This publicly created webservice can be consumed in the application But my requirement is I have to create a webservice to expose the schema and cannot be consumed directly.How to consume the web service which is not exposed directly.
I am using the Page Methods of Asp.Net Ajax to call the server method by enabling EnabledPageMethods of ScriptManager to "True". Can we return the DataSet using the Page Methods written on server side?
And also I want to know what are the default datatypes that are supported by the Page Methods to return to client?
public static class PageExtensions { public static int GetUserId(this Page targetPage) { var user = Membership.GetUser(targetPage.User.Identity.Name); return (int)user.ProviderUserKey; } }
Now in a page I need to use this method in a static WebMethod, so I have added another 'extension method' to PageExtensions:
public static int GetUserId() { return (int)Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey; }
and I call it as follows in my WebMethod: PageExtensions.GetUserId()
Below is some code. The save() method was pre-existing. I added the saveRanking() method. When I walk through the code, it hits the method, but then it just bails out of it. No exception (that I can see). Do I need that function(data) part? Code: function save() { $.post( "/Applications/SaveStatus", [code]....
Scenario is, I have a tab container inside which I placed 5 tabs and each tab having 4 Cascaded dropDown.Now for changing the tab page everytime refreshed and calling all 5 parent control dropwdown to fill.But can I prevent it in that manner so that for changing the tab only that parent webmethods will be called to populate.In page load itself it will call only the active tab parent Cascading dropdown web method.
I am showing state,city, zipcode in cascaded format. I designed cascade dropdown with asp dropdown list controls. I am loaing the citys & zipcode based on selection index changed.. here when I am selecting city the request is sending to server & its loading citys....
I don't want see post back operation on my page when I am selecting city & zipcode. So I am thinking to use Ajax cascade dropdown list to avoid sending the request for each selection.
If I use Ajax Cascade dropdownlist can i cascade the loading of citys & zipcode without using webservices?
If I use only webmethods for cascade dropdown it will work ?
I'm using ASP.NET page methods to check for the updates. I'm using inproc sessions and windows authentication in IIS 6. When page is loaded, a session is started. But sometimes when the page method is called it starts a new session(created with current request return true also). Why that might happen ?
I'm having problems with accessing querystring params in my page method. Everywhere I read it says you can access querystrings just fine, but when I try it just returns null, what's the problem?
I am using an AJAX dropdownlist control with two dropdownlist. Instead of using a webservice to populate the data, I used the pagemethod to populate. My problem is the second droplist won't populate. I get a server error, 500 in the droplist. The first droplist populates fine.
BUT here's the real kicker. If I reverse the order of the public static function such that GetHelloList2 comes BEFORE GetHelloList1 in the code, then the GetHelloList2 works ...... it just seems like it is only firing one pagemethod event and allowign only one.
Old school coders are used to having every server control create events in the .cs files.. for example.. Getting the Initial load of data, Saving Data, Deleting data... and then binding datasources to the server control..
New school coders want to do it in Jquery + AJAX calls to .svc files... That gives automatic no post backs so that is a advantage... and I think its a different way of thinking.. All of a sudden the UI related events are all being done in Jquery..
What is the most modern and efficient way to go ? How can I convince the old school coders to let us you this new paradigm ? (assuming it is the better way)
I have created a web aplication in the following environment Visual studio 2008, IIS 5.0 & OS:Windows XP. It is working fine in my local system. But when I host this application on the server some of the AJAX methods are not working.
The server environment: They have installed Microsoft .Net framework 3.5, IIS 7.0 & OS:Vista.
I am using a text box in that application. When a user types any character say 'a' a div will be opened below the text box displaying all the cities starting with the character 'a'.
for example this is code where I have written the Ajax method
[Code]....
I am calling this Ajax method in the source file through javascript, below is the code
[Code]....
The ajax method which was written in the .cs file returns the response.value correctly in my local system.But in the server the Ajax method is not returning the response.value.
I am building a sort of administration control panel which is basically just giving the end user the ability to manage the database through my app rather than knowing Management Studio. Creating lists of users, creating events that the users can attend etc, nothing too complex. So I am basically building the whole thing using JQuery AJAX with ASP.Net to make the DB connection and what not. My Jquery code just calls a different static method in my pages code behind for each different task, passing JSON back and forth.
From what I've seen results-wise so far, my interfaces are much quicker (almost instant) and even tasks on the server take less time to return through JQuery. But if you looked at my javascript code, you can see the "Page.aspxMyMethod". That means that people can access my methods just by sending a request from anywhere? Will forms authentication prevent this because it goes through an aspx page or what?