943,725 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 443
  • ASP.NET RSS
Jul 13th, 2009
0

Someone help me if possible!

Expand Post »
Hello all,
im writing an ASP.NET application and i wonder if is there a way that can i obtain the ASP.NET markup code(e.g. <asp:button etc etc) of a control that it is created 'on the fly'.


Please answer me as soon as possible,
Alex
Reputation Points: 11
Solved Threads: 12
Junior Poster
Alexpap is offline Offline
117 posts
since Sep 2008
Jul 13th, 2009
0

Re: Someone help me if possible!

i dont understand your question.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Jul 13th, 2009
0

Re: Someone help me if possible!

In short -- no. For standard <asp: you don't have to worry about tag prefixes either that you might with third party controls. Why are you trying to get at designer generated code in your application anyway? It isn't valid markup .. unless you are trying to write a code generator for making asp.net pages?
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Jul 14th, 2009
0

Re: Someone help me if possible!

do u mean .....you want to create the control on the fly...?
Reputation Points: 28
Solved Threads: 106
Banned
dnanetwork is offline Offline
633 posts
since May 2008
Jul 14th, 2009
0

Re: Someone help me if possible!

Click to Expand / Collapse  Quote originally posted by sknake ...
In short -- no. For standard <asp: you don't have to worry about tag prefixes either that you might with third party controls. Why are you trying to get at designer generated code in your application anyway? It isn't valid markup .. unless you are trying to write a code generator for making asp.net pages?
That's exactly what i want to do. do you have any idea how can i do this?

Or can you provide me with other solutions that can help me in this situation?
Last edited by Alexpap; Jul 14th, 2009 at 7:52 am.
Reputation Points: 11
Solved Threads: 12
Junior Poster
Alexpap is offline Offline
117 posts
since Sep 2008
Jul 14th, 2009
0

Re: Someone help me if possible!

Can you just build a list of known controls and use that? When you drop a control on the designer it calls RegisterTagPrefix() which handles getting the prefix name if it is already in use etc etc.

I would recommend dropping the controls on a form and getting the string values and going from there. You also have to update the .designer.cs file with the control names and classes. This isn't a straightforward thing to do but it can be done
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Jul 15th, 2009
0

Re: Someone help me if possible!

what do you mean the string values of the control??
Reputation Points: 11
Solved Threads: 12
Junior Poster
Alexpap is offline Offline
117 posts
since Sep 2008
Jul 15th, 2009
0

Re: Someone help me if possible!

Drop a control on to a web form and copy the code from the designer. Get the list of all designer generated code you need from hand. It shouldn't take more than 30 minutes to get them all. I think it may take hours to reflect out the information you need.. if its even possible.
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: How to refresh main page in popup screen
Next Thread in ASP.NET Forum Timeline: Date Comparison





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC