|
It would appear that you're exactly right. When I popped open Reflector and took a look at the Render method for the TextBox , it does not make the standard call to RenderChildren . In order to have the child control render, I had to override the Render method. This worked for me:
public class MyControl : TextBox { protected override void CreateChildControls() { this.Controls.Add(new HiddenField(){ ID = "MyHidden", Value = "TEST TEST TEST" }); base.CreateChildControls(); } protected override void Render(HtmlTextWriter writer) { this.RenderChildren(writer); base.Render(writer); } }
The above will render the Hidden field before the TextBox itself, if that matters to you. You can change the behavior by delegating to the base Render first, then calling RenderChildren .
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
Hi Jesse,
It works like a charm!
Thanks so much for your help!
MoE
|
|
|
|
|
My pleasure. I'm glad it worked out for you.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
Here is my situation: I have a Windows hosting with ASP.NET 2.0 that also features Access database support, and also SQL server but that costs a lot and I cannot afford to pay the price yet. What I want basically to do is to write a web service that stores and retrieves date on the web site, so that people can access it wherever they are. I'm not talking about thousands of transactions per minute. Well actually there might never be more than one user at any give time (but that's not guaranteed).
Is there some way I can use any free SQL server application? Like sqlite or Microsoft SQLCE?
Of course I have absolutely no way I can install additional applications because this is just an average hosting plan at an average hosting company.
Well, if you have any other ideas, I'd be very happy to read about them.
Thank you very much!
|
|
|
|
|
I'd change hosting company, I have one of my sites hosted on a basic plan with SQL server support for €5 per month.
|
|
|
|
|
Is there some reason that you wouldn't use the Access support offered by your provider until your site traffic outgrew it? If you are using a web service as a facade for data access, you should be able to, in theory, change configuration to point to a SQL Server (or other) data source in the future with little to no interruption in service.
Otherwise, you seem to have hit the nail on the head in your post. Because you have limited access to the box, your options are likewise limited. Most database products, SQLCE included, require some sort of installation in order to function. I have no experience with sqlite, but from a quick read of their site, it appears that it also requires some sort of installation.
One option that you may consider is constructing an ADO.NET dataset with your tables, which you can then deserialize, use, and cache, from your webservice. Though, if this were a viable approach for you, my opinion would be that you were still better off using Access.
Hope that helps a bit.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
I have a problem with inserting data
I want to insert a some data into TABLE1. The insertion code i written in Button_Click event.
For Ex:
<table1>
time NAME
6:15 sam
6:16 jhon
6:18 david
When click on BUTTON its inserting into <TABLE1>.When the time of first Button click Its OK.But when click on button again its adding 2 times, When keep clicking on its continously adding. Like this...
<table1>
time NAME
6:15 sam
6:16 jhon
6:18 david
6:15 sam
6:16 jhon
6:18 david
I want a OUTPUT like when click on BUTTON in 2nd Time it should display same data No repeting data.
when the NEW Recrod came it add Only that.
Please Help me i am very much thanful to you.
s_k_sameer@yahoo.co.in
|
|
|
|
|
|
Since it appears that you're rebuilding the data at each postback, you may wish to consider setting EnableViewState to false on your table. Doing so will prevent the state of the table from being preserved between postbacks, and will also reduce the size of the page that you're rendering.
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
|
Hello all,
i'm new to programming,
i want to create a list of class.
i searched in google but i didn't find any thing with this title.
i have a class it's name cartitem,another class it's name shopping and i want to create a list of cartitem object in shopping class.how i can do it with C# language?
please help me,
thank you,
Saba
|
|
|
|
|
List<cartItem> MyCartItems = new List<cartItem>();
|
|
|
|
|
using System;
using System.Collections.Gerenic;
public class ShoppingCart
{
private List<cartitem> _cartItems = new List<cartitem>();
public ShoppingCart()
{
}
public List<cartitem> CartItems
{
get { return _cartItems; }
set { _cartItems = value; }
}
}
</cartitem></cartitem></cartitem>
You can then create an instance of ShoppingCart and Add CartItems to it.
ShoppingCart cart = new ShoppingCart();
cart.CartItems.Add(new CartItem(price, quantity, description));
Hope that helped and that code doesn't break as I hand wrote it. But that should point you in the right direction.
|
|
|
|
|
Hi,
I was wondering if there is a way to perform a batch file upload. For example, the user clicks on browse and selected multiple files. A bit like we can do with WinForms OpenFileDialog. I didn't see that it is possible using the FileUpload control. Did I miss it? If not, is there another way of performing batch uploads?
Thanks,
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook
|
|
|
|
|
|
Thanks for the quick reply.
Yes I have seen this article. I can also use the Telerik FileUpload control where the user would be able to dynamically add as many files as he wants, but still this would be tedious as he would have to click "new" for each new file to upload (when you have like 100), whereas a batch selection would be easier for him. I kind of had a feeling that it would not be possible, but maybe someone has found a way
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook
|
|
|
|
|
Hello,
I have a confirmation page that displays information after submitting it from WebPage 1. However I was wondering if there was any code (C#) that will let you go from the confirmation page back to WebPage 1. The thing is once you are back on Webpage 1, I am wanting the textboxes to be filled in with the information that was on the confirmation page. Basically, in other words I would like it to work like the "Back" button in a web browser. Thanks!
|
|
|
|
|
<a href="#" onClick="history.go(-1)">Back</a>
|
|
|
|
|
Where would I go about placing this code then?
I am wanting to use this if the user checks the confirmation page..their information is incorrect they can go back to the previous page and correct their information.
modified on Wednesday, March 26, 2008 10:34 AM
|
|
|
|
|
you could put it in the c# if you like, put it in the page load maybe
|
|
|
|
|
Currently i m using ASP.NET with C# (.net 2005, 2.0 framework)
http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm
from the above like i download the menu and implemented.
but the thing is, when i put the dropdown menu bar by separatiing in <frames>,
the menu is not getting dropdown...
how to overcome it? help me plz.. ITS URGENT!"
|
|
|
|
|
First of all, why do you scream in your subject
Second... Every post here is urgent... ofcourse...
Third... Why use frames?? Use tables instead and you're done...
|
|
|
|
|
I wouldnt use frames
Use div tags to do your layout
|
|
|
|
|
acutally i m trying to split the screen into two so that the top frame may have the menu according to the login's (user,validator,supervisor) all these three users have different menubars. the bottom frame will contain the pages.
|
|
|
|
|
The other responses are correct in that your problem appears to stem from your use of frames. For all intents and purposes, the boundaries of a frame are treated just like a browser, from the content's point of view. What this means is that you will never be able to have your menus extend outside of their containing frame. Because the menu is contained within the frames, when it drops down, it must do so in the same frame. I would venture to guess that the containing frame is too small to display the drop down content.
It would seem to be that your best option is to reconsider your use of frames. I understand that you are attempting to display a different menu depending on the role that the current user holds. Is there a reason that you are unable to implement that decision on the server-side?
For example, one thing that you may consider is to create each version of your menu as a user control (using div tags, not frames) and dynamically loading that based on your user's role. Lets assume that you left a Placeholder control in the markup where you wanted to inject your menu. The code would look something like:
MyMenuControl myMenu = null; if (this.User.IsInRole("Admin")) { myMenu = (MyMenuControl)LoadControl("~/menus/adminMenu.ascx"); } else if (this.User.IsInRole("SomeRole")) { myMenu = (MyMenuControl)LoadControl("~/menus/someRoleMenu.ascx"); } else { myMenu = (MyMenuControl)LoadControl("~/menus/userMenu.ascx"); } this.MenuPlaceHolder.Controls.Add(myMenu);
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|