|
I refer you to the answer I gave some moments ago.
|
|
|
|
|
Hello,
I am using ASP.NET 2.0. I am trying to add textBox programmatically.
I am following method.... It is not working. What do I need to add.
protected void Page_Load(object sender, EventArgs e)
{
TextBox textBox = new TextBox();
textBox.Text = "Joe";
Panel panel = new Panel();
panel.Visible = true;
panel.Controls.Add(label);
}
Thank you,
|
|
|
|
|
You have to add it to the Controls collection on the page.
|
|
|
|
|
Hello,
Thank you for your reply. I know it's simple. But it is not working when I add.
Page.Controls.Add(panel)
to the above page.
Please, send me a working one.
Thank you
|
|
|
|
|
You originally said "I am using ASP.NET 2.0. I am trying to add textBox programmatically."
So, why did you add the panel? You should add the text box.
|
|
|
|
|
Hi, I am creating a forum type. This forum consists of many sub forums in it for example: Computers, Gadgets, Music etc.... Users will login to use this forum for their own use of trading objects and bidding on object. The problems I am facing right now that I don't know are these:
1. I know how to make a datagrid with pages (After 10 post it creates another page) .. but I don't know how to access the second page of that datagrid. Can anyone help me in this pls?
2. How to upload pictures using asp.net in Ms Access database not sql.
3. How to make links from a datagrid (each row has a link) to a specific page. How can I make this happen because i dont know how to grab a specific link that the user chose.
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
1. look here, when the pagination is on, it comes in number format, like 1,2,3,... or in Previous/Next format. consider the previous next format. when you are in page 5, and click next, the next page index is 6. so e.NewPageIndex = 6.
2. I will prefer to keep the images in a folder in the webserver, and keep the path of the images in database. This is done the way I have told in my previous mail.
3. Lets say your object id is objid in the database and you are binding the datagrid with a datatable which get filled from the database table of objects. Now the column will be something like this
<br><asp:TemplateColumn HeaderText="Object ID" Visible="False"><br><br> <ItemTemplate><br><br> <a id="lnkID" runat="server" href='Newpage.aspx?id=<%# DataBinder.Eval (Container.DataItem, "ID") %>'>><%# DataBinder.Eval (Container.DataItem, "ID") %></a><br><br> </ItemTemplate><br><br></asp:TemplateColumn><br><br>
For more on datagrids, read my article How to create the id of <td> and <tr> generated by DataGrid in ASP.NET and use it by client-side JavaScript.
Hope this will do.
Pradipta Basu
|
|
|
|
|
Sorry for this inconvenience .. but how i do know the page pls of the datagrid. because I am entering the DataGrid1_SelectedIndexChanged and I am making this as you told me ..
DataGrid1.CurrentPageIndex = e.NewPageIndex
An error is occuring here. red line enderneath this line. why is this? Thanks alot.
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Hi .. sorry but I solved the problem of question one.. Thanks alot. I was making a mistake because I want to code in the PageIndexChanged. Thanks alot. Now a problem is occuring because every time I click on the next button .. it refreshes the page and do nothing else .. it stays on the same page (it stays on number 1), then when i press it the second time it goes in number 2. Do you know whats the problem pls?
For the images .. they are 100% working thanks to you.
Now for the Links within the datagrid I didn't put the code right now. I will try it out later.
Thanks alot
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Hello,
Yesterday I was getting mad with a conversion from Dynamic pages to static HTML one, Today I've succeded in my tries, retrieving all pages that are referred by a DropDownList recreating the POST request to a website.
In order to do that I used the viewstate sent by browser and inserted it hardcoded in my class.
I've seen that some view state decoders accept an input an URL and they decode the viewstate, my question is : How can I get viewstate starting from HttpWebRequest and HttpWebResponse???
Thanks a lot
Bests Regards
Paolo Ponzano
|
|
|
|
|
To access viewstate from the client simply store the value you are seeking in some html element via your server code. Then use javascript to access that element.
|
|
|
|
|
hi all,
when i press enter the entire form is clearing as i have button for clear function..
i want to give focus to next control on enter key, how do i manage to to do this?? how to control users key codes??
|
|
|
|
|
Check this [^]
or this[^]
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
Smiles74 wrote: i want to give focus to next control on enter key
You really shouldn't do it that way - the Tab key is there for that purpose...is the Tab key not suitable for some reason.
The only reason I mention this is that in my experience, if you need to do something "unusual", then it's really a workaround for another problem...
Oh, and it'll confuse the HELL out of your users too
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi All,
I m working on Datagrid using VB.NET as code behind. Can Some one tell me how to display Columns as row wise. I mean I have few columns in Datagrid. I want to display these column to be displayed as Row.
|
|
|
|
|
Can you be a bit clearer ?
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
Dear I take Data from Database and display in datagrid templete columns like following
Name Address Phone
Arif Hangu 98766
I want this should be displayed in Datagrid like following
Name Arif
Addres Hangu
Phone 98766
How is that posible in Datagrid. (ASP.NET)
|
|
|
|
|
Use repeater instead.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
I'd like to encrypt the connectionstring in the web.config file for a shared host website:
I read the following text:
http://aspnet.4guysfromrolla.com/articles/021506-1.aspx
How can i use this example for a website on a shared host?
I watched the following video:
http://www.asp.net/learn/videos/view.aspx?tabid=63&id=39
This example works fine on my local Pc (localhost). But if i copy the web.config to the shared host, the solution doesn't work.
How can I use this example for a shared host website?
Thanks for your support
ullk
|
|
|
|
|
Does anyone know how to take data from the gridview and put it back into a datatable or dataset?
|
|
|
|
|
You can use itemdatabound on the grid to copy the contents to a datatable while the table is loading.
I used a free (on codeproject somewhere) grid to excel converter which could be used.
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
I already have the data saved in viewstate. The problem is that having all that data in the viewstate is not good for the performance of the application. What I am trying to do is filter my grid without having to requery the database.
|
|
|
|
|
Save the data in session/viewstate as serialised object.
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
I want how to start designing a web page in asp.net.
Can any say about this
|
|
|
|
|
Start with a pencil and paper. I'm not kidding !!! Plan it out the design and then develop the design in asp.net
ASP.NET is not a website designer it is an application platform.
If you website requires no code or application funcationality then don't use asp.net use an Html IDE, even MS provides a free web design tool.
ANYWAY...... The secret to website design is tables with no boarders. This allows the content of your webpage to be presented in a consistent manner and layout.
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|