?
Solved

static and call non static constructor

Posted on 2015-01-20
6
Medium Priority
?
161 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:Seven price
  • 4
  • 2
6 Comments
 
LVL 45

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:Seven price
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:Seven price
ID: 40560536
unless there is a way to add your asp.net controls to a static method.?
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
LVL 45

Accepted Solution

by:
AndyAinscow earned 1500 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:Seven price
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:Seven price
ID: 40560687
o
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month15 days, 7 hours left to enroll

840 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