Solved

static and call non static constructor

Posted on 2015-01-20
6
145 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
[X]
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
  • 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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

729 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