|
Create the dynamic control on the Page Init event, so that the control will participate in the Viewstate. You will be able to read the contents as you normally do with static texboxes. This article may help you through...Dynamic Controls[^]
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
|
|
|
|
|
Am suggesting a simple way.Declare a static variable count in the page.While creating textbox give the ID of the textbox as count+1;
when u need the data for saving,iterate through for loop by using the count variable and find the control using this count as ID.
Arun J
|
|
|
|
|
Creating a static variable will give problem nothing than else
what for another user ? this count is going to be share by them also
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
If static variable will cause problem,then just use viewstate.It'll work fine.
Arun J
|
|
|
|
|
Dear Programmers,
I am facing a new problem. I have imports to files
imports system.data
imports system.data.sqlclient
I have also added reference of these two files through Add References.
It show me their classes but when i execute the application it gives me the error at those places where i have used object of the above mentioned classes.
Please help me in this regard. what shall i do to get rid of it?
Waiting for your replys
|
|
|
|
|
I don't know where we can use import keyword in C#. Might be you are developing your application VB rather than C# then you are at wrong place. Place correct forum for this.
Again verify those dll should present in your application.
Add these dll to your project then import where you want to use them
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
playing with bugs ) wrote: I don't know where we can use import keyword in C#.
Imports statement is used to import namespaces in VB.NET. I think Using is the equivalent in C#.NET.
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
|
|
|
|
|
Can you please post the details of the exceptions you are recieving.
Thanx...
Clean code is the key to happiness.
|
|
|
|
|
protected void Menus_MenuItemClick(object sender, EventArgs e)
{
//string x=(string) e.Item.Value;
MenuItemCollection m = new MenuItemCollection();
//System.Web.UI.WebControls.MenuEventArgs x = e.ToString();
}
i want to know which item of the menu is click .
please let me know .
|
|
|
|
|
The 2nd argument for the event handler should be of type MenuEventArgs . You can reference the selected item from the information exposed by this type.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi all
while running my application am getting an error like this :-
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 38: by Microsoft that offers a single logon and core profile services for member sites.
Line 39: -->;
Line 40: <authentication mode="Windows">;
Line 41:
Line 42:
can u say wht might be the problem?
|
|
|
|
|
Did you try Google to find out what the error message means?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi i have doubt regarding interfaces...
Suppose in my project i have one interface with 30 methods...
I used this interface in many classes through out the application..
if i suddenly added another method in this interface... i need to change all the files through out the application...
Is there any alternative for this? If i change any modification in interface...shall i need to change in all files..?
Please give reply if any body knows the result..
Thanking you
G. Satish
|
|
|
|
|
Yes. When a class implements an interface, it should contain all the methods written inside interface. That says a change in interface will affect all it's implemented classes.
modified on Thursday, January 31, 2008 3:36:30 AM
|
|
|
|
|
But if interface contains 100 methods means, we used this in many of the classes in the big application, we didn't remember where we implemented this. At that time, any changes to interface...what to do?
any alternative method for this?
G. Satish
|
|
|
|
|
That's the reason why interface should not have many methods instead you can break up these methods in many interfaces depending on the similar functionality this could be the one of the reasons why you can implement more than one interface in C#,
Creating one more interface could be alternative solution now as you made really big mistake while designing your application.
It's my view comments are accepted
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Satish - Developer wrote: But if interface contains 100 methods
100 methods in an interface ? It doesn't sound like a good design.
|
|
|
|
|
As others have already said, 100 methods in an interface = design problems.
Having said that, the way around having to implement the method in every derived class is to start with an abstract class rather than an interface. This can provide default behaviour for a newly added method which only needs to be overriden in classes where you want to vary this default behaviour.
|
|
|
|
|
My searches yield a myriad of mash-ups that provide my required behaviour of a three column, server control, drop-down. Could anyone please recommend a tried and trusted solution for me?
|
|
|
|
|
i am having an image button and i need the click event of the image button to fire but postback should be prevented,is it possible.I tried several methods but didn't worked for me.I even replaced the image button with a image control and used javascript,but still it didn't worked for me.
My requirement is that on the image button click i want to make another web control visible but i need to prevent postback once the click event is fired.
Can any one help?
Thanks in advance
|
|
|
|
|
why don't you use image html instead of asp:imagebutton ?
on image html you can create onclick or onclientclick eventhandler to fire your method that will show your control.
hope it helps
|
|
|
|
|
i have tried with html control too but didn't worked for me.
|
|
|
|
|
Anupbala wrote: i am having an image button and i need the click event of the image button to fire but postback should be prevented,is it possible.
Nope. As it is a server-side control, it would Postback.
Anupbala wrote: My requirement is that on the image button click i want to make another web control visible but i need to prevent postback once the click event is fired.
You can do it using JavaScript. But do not set the Visible Property of the Web Control to false. If you set it, the page would not render that control. So, you will not able to find the control using JavaScript. Use Style property to set the visibility/block. Then write your code to make it visible/hidden
|
|
|
|
|
i want to hide an asp:menu,how can that be done using style property?
|
|
|
|
|
ASP.NET render menu control as HTML table. So you can find this element and change visibility using JS.
|
|
|
|