Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

static and call non static constructor

Posted on 2015-01-20
6
140 Views
Last Modified: 2015-01-20
Ok when I submit to the static method to call the non static I cannot retrieve asp.net control values. only if I put it in a submit button. any suggestions.

[WebMethod]
        public static string mymethod(test[] tester)
        {
          
            Class foo = new class();
            foo.loadcontrol();
}

  

void loadcontrol()
{
int mygroupid;
 mygroupid= int.Parse(dropdownlist.Value),

}

Open in new window

0
Comment
Question by:sevensnake77
  • 4
  • 2
6 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40560520
>> any suggestions.

A little more explanation.  I don't understand what you are doing or what your problem is.
0
 
LVL 9

Author Comment

by:sevensnake77
ID: 40560531
ok static method calling a non static method.  I need to retrieve the values from the asp.net control dropdownlist and textbox. I know it looses it when submitting to the method first but I am using a static method to also send json values.
0
 
LVL 9

Author Comment

by:sevensnake77
ID: 40560536
unless there is a way to add your asp.net controls to a static method.?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 40560545
If I understand you right then no can do.
A static method does not know anything about the current object, unless you pass an instance into the static method.
0
 
LVL 9

Author Comment

by:sevensnake77
ID: 40560561
Well the example I am showing up top allows it to hit the non static but yea cannot get the control values. looking at alternatives.
0
 
LVL 9

Author Closing Comment

by:sevensnake77
ID: 40560687
o
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question