Current time: 05-22-2013, 08:31 PM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
System.UnauthorizedAccessException: Invalid cross-thread access error
07-19-2012, 03:15 AM
Post: #1
System.UnauthorizedAccessException: Invalid cross-thread access error
 hello,
           i'm getting this error when i'm trying to bind data dynamically from a textbox control to a method,
here is the code...
  private void btn1_click(object sender, routedeventargs e)        {            httpwebrequest request = (httpwebrequest)webrequest.create(new uri("http://postbox.instasecure.com/service/soap/"));            request.method = "post";            request.contenttype = "application/json";            request.begingetrequeststream(new asynccallback(createtagrequesthandler), request);        }
 void createtagrequesthandler(iasyncresult asyncresult)        {            httpwebrequest request = (httpwebrequest)asyncresult.asyncstate;           //getting that error near s...          string s = createtagxml(txtname.text.trim(),txtcolor.text.trim());            streamwriter postdatawriter = new streamwriter(request.endgetrequeststream(asyncresult));            postdatawriter.write(s, 0, s.length);            postdatawriter.flush();            postdatawriter.close();            request.begingetresponse(new asynccallback(createtagresponsehandler), request);        }
 thanx in advance,
hari 

View Complete Post
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Invalid cross-thread access after created a new SilverlightApplication in Page.xaml design mode admin 0 30 07-29-2012 06:20 PM
Last Post: admin
  Error Cannot convert from 'System.Collections.Generic.List<int>' to 'System.Collection.ObjectModel.ObservableColle admin 0 33 07-29-2012 06:20 PM
Last Post: admin
  a System.UnauthorizedAccessException caused by HttpWebRequest async response handler, who can help me ? admin 0 70 07-29-2012 06:20 PM
Last Post: admin
  Error: the XML response that was returned from the server is invalid. admin 0 21 07-29-2012 06:20 PM
Last Post: admin
  • Cross Domain Network Access admin 0 35 07-29-2012 06:20 PM
Last Post: admin
  Blocking the UI thread before returning to a background thread admin 0 29 07-29-2012 06:20 PM
Last Post: admin
  cross domain configuration error - tried everything admin 0 21 07-29-2012 06:20 PM
Last Post: admin
  Invalid cross-thread access after created a new SilverlightApplication in Page.xaml design mode admin 0 46 07-29-2012 06:19 PM
Last Post: admin
  System.UnauthorizedAccessException admin 0 30 07-19-2012 04:45 AM
Last Post: admin
  cross domain configuration error admin 0 16 07-19-2012 03:15 AM
Last Post: admin

Forum Jump:


User(s) browsing this thread: 1 Guest(s)