|
No, I think if you open a 1.0 project it will ask you to upgrade it.
|
|
|
|
|
|
Hey guys,
I am working on a asp.Net (1.1) site. Basically I need to add a couple of new pages. The page would have a few drop down displaying bgColor options, font options, and text size. Now when the user selects one or all of these options, and click the submit button… I should be able to change the page’s look appropriately. So for instance, if a user selects red for the background, Arial for the font and 10 as the size…on button_click event these properties should apply to the page. Now I am grabbing the value from the drop down ( string currentColor = ddl1.SelectedValue; )
I notices that the page control, doesn’t have the body or html form element, so now how do I apply this color property for example to the entire page. My guess is I’d have to go under HTML mode of aspx page and do it there.
Please suggest what is the best approach here.
Thanks
Tina
|
|
|
|
|
In your aspx page use a table element.
<br />
<table border="0" cellpadding="0" cellspacing="0" style="width:100%"><br />
<tr><br />
<td runat="server" id="tdMain"><br />
Put content here<br />
</td><br />
</tr><br />
</table><br />
<br />
Server side code should be like this<br />
me.tdMain.Style.Add(" background-color", "red");<br />
|
|
|
|
|
Thanks for the response. Like I said I need this to happen when the user clicks the button and the button click event fires. Which means either I should do it on the server side somehow under button1_click event handler or like you said in aspx page. What you have showed me, sounds like is static…it will change the color right away I only want it done on button click. Also shouldn’t I be using the whole body element (i.e. form1.Style.Add (“bgColor”. Red) since I want the color to be applied to the entire page???
Thanks
Tina
|
|
|
|
|
<br />
<br />
The idea is that you put all the content of your page inside the single table cell and it will affect the entire page.<br />
<br />
<form id="Form1" runat="server"><br />
<table border="0" cellpadding="0" cellspacing="0" style="width:100%"><br />
<tr><br />
<td runat="server" id="tdMain"><br />
<br />
ALL CONTENT<br />
<br />
<br />
</td><br />
</tr><br />
</table><br />
</form><br />
<br />
<br />
You can modify the style of tdMain from any event. You can add and remove style elements during the button_click event.<br />
GameFly free trial
|
|
|
|
|
Well it’s not a pretty simple page. It’s got 3 user controls and a lot of other UI elements. Please elaborate on how to apply the above mentioned properties when that button is clicked (as you said above “can add and remove style elements during the button_click event.”).
Thanks
Tina
|
|
|
|
|
Hi All
I have a web page, having two tables and lots of controls in them. when user finishes entering data in table1 and clicks button then second table gets enabled.
In the second table there is a user control and couple of buttons (btnContinue, btnClear). userControl consists of dropdown and textbox.
When user finishes entering data in textbox(Present in usercontrol) and press "ENTER" key, the btnContinue on aspx page should get clicked.
We are using Asp.Net 1.1, VS2003
Can some one help me coming out of this?
mk
|
|
|
|
|
Add the following to your aspx code.
<script type="text/javascript"><br />
function ButtonPress (evt, btnID) {<br />
if (evt.keyCode == "13") <br />
{evt.returnValue= false ; evt.cancel= true ; document.getElementById(btnID).click(); return false; }<br />
}<br />
</script><br />
<br />
In the codebhind add the following.<br />
Dim ObjButton as Button = UserControl.Findcontrol("ButtonId")<br />
<br />
Me.Textbox1.Attributes.Add("onKeyPress", "ButtonPress(event, '" & ObjButton.ClientID & "')")<br />
<br />
<br />
Does that help?
GameFly free trial
|
|
|
|
|
Hi ToddHileHoffer
I understood the script, but not the codebehind code.
can you elaborate a bit.
// Dim ObjButton as Button = UserControl.Findcontrol("ButtonId")
My Button is in aspx page and text box in user control.
// Me.Textbox1.Attributes.Add("onKeyPress", "ButtonPress(event, '" &
ObjButton.ClientID & "')")
what is C# equavalent for "Me" ?
And more over do i need to write this in code behind of aspx page or UserControl?
Sorry for confusion.
mk
|
|
|
|
|
sorry, here is the C# for your code behind.
<br />
Textbox txt = (Textbox) Usercontrol.FindControl("TextboxID");<br />
this.txt.Attributes.Add("onKeyPress", "ButtonPress(event, '" &<br />
this.Button.ClientID & "')");<br />
Does that work for you?
|
|
|
|
|
Hi ToddHileHoffer
It worked perfectly. Thank You Very Much.
|
|
|
|
|
I am looking for a Complete ASP.NET Forum Source Code(free).If I get one It will be gr8.Otherwise I have to create my site's forum.Plz tell where I can get Complete ASP.NET Forum Source Code(free).
|
|
|
|
|
|
Yahoo store has the option of recieving realtime orders using http post in xml format. Yahoo has the ability to call a page on our webserver along with the xml data in http post. I created the following code to try and retrieve the post, but when I Response.Write the output it is blank.
Page.Response.ContentType = "text/xml";
// Read XML posted via HTTP
StreamReader reader = new StreamReader(Page.Request.InputStream);
String xmlData = reader.ReadToEnd().ToString();
Does anyone know of another method to retrieve the xml in http post using asp.net and c#. Thanks in advance.
|
|
|
|
|
hi,
i have one table, inside that table i am creating two panels
now i need to put one line between two panels or can u tell how to differentiate two panels.i dont want to aplly the bgcolors.
|
|
|
|
|
In your html on your table you can make the border of any element visible.
EG style=" border-bottom-style:solid; border-bottom-width:thin; border-bottom-color:Gray"
|
|
|
|
|
hey guys
The user shouldn't put any html tags in the TEXTBOX, how can i handel this.
Estarta
|
|
|
|
|
User regular expressions to find any html.
Check this link for more info about regluar expressions and then be creative.
|
|
|
|
|
thanks alot for your reply, but this not what im looking for
i wanna prevent the user from using HTML tags or any special characters in the input box.
thanks anyway
Estarta
|
|
|
|
|
In order to prevent the user from entering any html on the client you will need to use javascript. Check here
|
|
|
|
|
this is wat im looking for Thanks alot buddy
Estarta
|
|
|
|
|
Use HttpUtility.HtmlEncode() or Server.HtmlCode to encode html on the server side
|
|
|
|
|
Hi All,
I have Visual Studio 2003 & 2005 installed on my PC. (OS - Windows XP).
For ASP.NEt application, if I try to run in debug mode I am getting following error.
"Error while trying to run project: Unable to start debugging on Web Server"
How I can enable debugger?
Please help me out to solve this.
Regards,
Amol
Every thing will come to you if you have faith.
|
|
|
|
|
Check whether the application mode is dubug or release, if it is release them make it to debug. Also you can have a look at the config file there also it may not be in debug mode.
Best Regards,
Apurva Kaushal
|
|
|
|