Showing posts with label based. Show all posts
Showing posts with label based. 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!

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.

A high level ATLAS implementation question.

Hello, we are looking into this technology for a project currently in design.

The project is comparable to a browser based chat application so for the purpose of this post I will use a chat example.

  • Five users join a chat session
  • One person types a message and sends it to the group
  • The list of chat messages is updated for each user.

    Let's say the app needs to scale to 10,000 users and the messages are stored in a database and managed on the server.

    We could use Atlas to send the message to the server when the user clicks Send – this works great. My dilemma is how to update each client with the new chat message. We have considered using a timer on the client and polling the server using Atlas for new messages. However, this seems inefficient and doesn't scale due to our capacity requirements and all the net traffic this could produce.

    Is there a way to employ more a broadcast model using the Atlas technology? Could we use an Event in the server code that makes anOnCompletecallback to each cleint who's joined the session? Is there another way to message from the server to multiple clients?

    Thanks in advance for any advice you can provide, links, documentation, examples, etc...

    Kind Regards.

    Sounds like you should use a "Broadcast Pattern".
    ie.
    - all active users become part of some "active user broadcast list" as they join a chat session
    - then some class/thread is invoked to broadcast the message to all users in the list
    In between or after you can store the message in a db or whatever.
    dev


    Dev, thanks for the response.

    Yes, the broadcast pattern is along the lines we're thinking. The question is how to implement this model.

    I imagine we could wire up an Event in the server code that would fire when there's a new message submitted by any client.

    How then would the server broadcast the message to each of the web clients who are participating (up to 10000). Could an individual thread be kept alive somehow on the server for each client? This is where we were thinking about the OnComplete logic supported by Atlas. It seems like there's an AJAX solution out there somewhere for this.

    Thanks in advance for any more advice.


    Hi Bill,

    Here is how you could implement your chat s/w:

    Server side:
    Create the below webmethods:
    1. UpdateMe_async()
    polls the db for new messages. When new messages are available it returns an array of messages and client ids.
    2. ReceiveMsg(messagestring, clientid, otherparams...)
    Receives and adds the message to the db.

    Client side:

    Do the following:
    Onload:
    Make an async call to UpdateMe_async() webmethod. Set the call back to a function say func_UpdateMe().
    func_UpdateMe()
    Displays messages.
    On send button click:
    Make a call to the ReceiveMsg() webmethod.


    Hope it helps!

  •