Showing posts with label upon. Show all posts
Showing posts with label upon. Show all posts

Wednesday, March 28, 2012

Accessing profile info from Webservice

This is the situation I'm facing: I have a AutoCompleteExtender which fetches data based upon the information stored in Profile fields. When I write the code for the webservice connected to the Extender, I cannot access the data in asp.net's User Profiles. I have a suspicion this is because a web service is not really part of the website, but rather a standalone application.

Is there a way to use the Profile information in a web service?Nobody out there with an answer?
If the web services are part of the app, then there shouldn't be any domain access issues. Can you copy up your code?
I found out how to do it: apparently one needs to access the httpcontext in order to retrieve the Profile information:

Context.Profile["group.name"].ToString()

thank you for posting this!

i've been looking everywhere for such information, and even wrote a post on this board half hour ago after google groups search, but than came across your post and i will be able to sleep tonight.

thanks again!

accessing controls from diff updatepanels

Hi

Just wondering is it possible to access controls from diff update panels

I have a treeview in 1 updatepanel, upon selecting a node in the tree I want to display a panel outside the updatepanel, possibly in another updatepanel

confusing? maybe

Dim panel1 As Panel = CType(Me.UpdatePanel1.FindControl("panel10"), Panel)

Panel1.Visible = True

It definately finds the contro, but will not mae it visible

thoughts ?

Hi!

Are you calling UpdatePanel1.Update() after you set the visible property to true? If you are missing that the Panel will be "visible" but not "showing" as visible.

Also, just a doubt: Why you need to use FindControl to find controls inside UpdatePanels? They aren't NamingContainers, thus you should be able to call them directly from the page.

Regards,

Juan


One more note: if you're talking about using a TreeView, note that the TreeView control isn't compatible with partial rendering (so it can't get updated inside an UpdatePanel). Seehttp://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx#UpdatePanelCompatibleControls.

A good way to think about the UpdatePanel is that it doesn't really change the way postbacks work. So if you can do what you want to with a regular postback, then it should just be a matter of wrapping the write regions of the page in UpdatePanels and setting up the triggers (or calling UpdatePanel1.Update() in the code-behind) to make sure those regions of the page get updated when appropriate during the async postback. My advice would be to get this working how you want with regular postbacks, then add UpdatePanels (which will by default all update on every async postback), and finally optimize by setting UpdateMode="Conditional" and setting up your triggers, so you selectively update the parts of the page that you need to.


thanks guys , some great advice there

UpdatePanel1.Update() was the key here


Steve Marx:

One more note: if you're talking about using a TreeView, note that the TreeView control isn't compatible with partial rendering (so it can't get updated inside an UpdatePanel). Seehttp://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx#UpdatePanelCompatibleControls.

Steve , Is this something that will be fixed in future AJAX releases

I also have some file upload controls on the page that I really need to have there

Wednesday, March 21, 2012

A push in the right direction please?

I would like to have two listboxes filled with sorting criteria, and based upon the two selections in the listbox utilize some ajax functionality to update a gridview on the same page on the fly without any postback. The gridview holds a bunch of printer information with multiple manufacturers. Based upon the manufacturer selected in the list box will cause the gridview sort out the matching values and display the gridview contents without the need for a postback. Keep in mind though that I will be using two listboxes which will determine two search criteria the gridview will utilize. Is it possible to have this done with the current ajax control toolkit? If so does anyone know of any good articles to read that will "push me in the right direction"? Thanks for the help!.

http://msdn2.microsoft.com/en-us/library/aa581792.aspx

Really, the only thing you'd need the AJAX toolkit for would be to wrap the two list boxes and the gridview in an update panel (or just wrap the gridview in an update panel and set the list boxes as triggers) to hide the postback.