Saturday, March 31, 2012
table sizing
I have inserted a table on the webForm via the HTML tool box, the one under components, and I can not create the 4x2 table. Each time I change the Rows to 4, it keeps getting changed back to 2 when I apply the change.
Why?Vs 03 is notorious for screwing up html code.
Best bet do this:
<table>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
Alternativly i think theres an insert table command on the menu for vs03, which should let you specify 4x2 and insert you a new table.
Or if the book is working from Web Matrix then maybe you should too, after all its a free download from this site :)
Hope this helps,
Andrew
You may be better off using the web form table, not the one on the html portion of the toolbox.
Use the table menu in the top menu bar.
Zath
Thanks, I am learning quickly the quirks of VS.
Thanks.
Table Sizing
I have a table with three columns but I want to make the left had column a fixed width?
Is this possible?
For example if the table is 300 pixels wide
I want column 1 to be 50 pixlels and column 2 & 3 125 pixles each!
anyone any ideas?
cheers
Tonyspecify width in pixels for first column, then percentage for other 2
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"> </td>
<td width="33%"> </td>
<td width="33%"> </td>
</tr>
</table
or size everything<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"> </td>
<td width="125"> </td>
<td width="125"> </td>
</tr>
</table>
Is that what you meant ??
col1:
width = 15%
col2 and col3
width = 42%
is that what you ment?
otherwise if you wanted col1 to always be 50 pixels
col1:
width = 50
withis the second column nest a table with two columns of width = %50
try that and tell me how it works
Monday, March 26, 2012
Tabs
Does anyone know any good websites for using asp.net web controlled tabs dynamically. For example adding validation using the tabs.
Cheers
Jamie
What do you mean by:>> adding validation using the tabs
Regards
I have a tab page which contains eight tabs. In each of the tabs is fields for a user to fill out. I was wondering when the user clicks on the next tab it will validate what was in the previous tab. e.g. they fll out their address details on one tab but forget to put in a postcode, I want it to validate this before they can access the next tab.
Cheers
This depends on if your tabs post back to update or not.
If they post back:
- Usually only the web controls that are visible in the tab are also marked Visible=true. All the rest are Visible=false. That prevents the validators that are invisible (or attached to invisible controls) from validating.
- The result allows the post back action to validate only the contents of the current tab. Its easiest on the server side, by calling Page.Validate() on the post back event handler for the Tab control (like its Click method). Then test Page.IsValid is true before allowing the tab to switch. If you want to add some client-side code to the tab's event that switches, you should call the same code used by submit buttons:
Page_ClientValidate()
If it returns true, continue switching tabs. False, stop switching tabs.
If they do not post back:
- This means all of the web control - even those that are hidden - are represented in HTML on the page. Those that are hidden have a style value of 'visibility:hidden' or 'display:none".
- If you were to call Page.Validate on the server side or Page_ClientValidate() on the client-side, all validators would fire. That includes the invisible ones. Those invisible ones would report an error (like the field hasn't been filled in yet via a RequiredFieldValidator). So it would not work.
- The solution is to use Validation Groups - available in ASP.NET 2.0 or myProfessional Validation And More. You define a group name for each tab. When you validate, you pass the group name for the tab into Page.Validate() or Page_ClientValidate().
- In addition, if you used my Professional Validation And More, the validators can be setup to detect that the data entry controls which they evaluate are invisible and will not attempt to validate them.
Tabs Control
I downloaded it but can seem to find the control, where is it located?
Please help!
Assistance would be great as this is very important.
Saturday, March 24, 2012
tabstrip control
Could anyone give me an example of how to do this?
TIAI don't know if you are looking for something like that howevertake a look here
TabStrip onmouseover
Thanks in advance.WoW, if it's "doable", then it's great. Imagine the Tab panel becomes bigger when we just move mouse over !!
So, anyone have an idea ?!?
Hi,
I guess you can change the look and feel of the tabstrip...
Also you can program for the events on a tabstrip...
Code snippet demonstartes changing the look & feel of a tab strip, while displayed,selected,hovered...
try it out...
<%@. Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls"%
<iewc:TabStrip id="LevelThreeTabStrip"Orientation="vertical"TabSelectedStyle="background-color:#ffffff;color:#000000"TabHoverStyle="background-color:#777777" TabDefaultStyle="background-color:#d2d2d2;font-family:verdana;font-weight:bold;font-size:8pt;color:#ffffff;width:168;height:21;text-align:center"
runat="server">
</iewc:TabStrip>
Tag prefix
I have two ASP.NET newby questions:
1. what and why are there tag prefixes (example <asp:...)?
2. why doesn't the following code (in VB.NET) render these prefixes?
Dim myTextBox As New System.Web.UI.WebControls.TextBox
Dim oStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(oStringWriter)
myTextBox.RenderControl(oHtmlTextWriter)
TextBox1.Text = oStringWriter.ToString()
Regards,
BlazWhat are u trying to do?
Do u want to use ASP.NET or VB?
"Blaz Ziherl" wrote:
> Hi all,
> I have two ASP.NET newby questions:
> 1. what and why are there tag prefixes (example <asp:...)?
> 2. why doesn't the following code (in VB.NET) render these prefixes?
> Dim myTextBox As New System.Web.UI.WebControls.TextBox
> Dim oStringWriter As System.IO.StringWriter = New
> System.IO.StringWriter
> Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
> System.Web.UI.HtmlTextWriter(oStringWriter)
> myTextBox.RenderControl(oHtmlTextWriter)
> TextBox1.Text = oStringWriter.ToString()
>
> Regards,
> Blaz
blaz,
Tag prefixes are used by the asp.net compiler to identify tags that should
be processed on the server. All stardard ASP.Net control have the ASP
prefix. If you build your own controls, you can use a custom tag prefix such
as:
<blaz:newlabel id="blazlabel1" runat="server" text="" /
If you notice the rendered HTML output on the client these server controls
have been rendered as standard HTML elements such as <select>, <input>,
<img>, and so forth. Browsers such as IE and Netscape cannot parse a
<asp:label> tag, the server handles this.
For the answer to question 2. What are you trying to do?
Add a text box to a form?
Dim tbFirstName as System.Web.UI.WebControls.TextBox
Page.Controls.Add(FirstName)
Read the text of a textbox?
Dim strFirstName as String = tbFirstName.Text
HTH MikeL
"Blaz Ziherl" wrote:
> Hi all,
> I have two ASP.NET newby questions:
> 1. what and why are there tag prefixes (example <asp:...)?
> 2. why doesn't the following code (in VB.NET) render these prefixes?
> Dim myTextBox As New System.Web.UI.WebControls.TextBox
> Dim oStringWriter As System.IO.StringWriter = New
> System.IO.StringWriter
> Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
> System.Web.UI.HtmlTextWriter(oStringWriter)
> myTextBox.RenderControl(oHtmlTextWriter)
> TextBox1.Text = oStringWriter.ToString()
>
> Regards,
> Blaz
Thanks for your answers!
About the rendering. Well I am trying to add an ASP.NET WebControls
support to my application that includes a simple HTML Editor. But
can't really figure out how could I generate <asp:...></asp:...>
formatted ASP code from any of the WebControls.
Any ideas?
Regards,
Blaz
Tag prefix
I have two ASP.NET newby questions:
1. what and why are there tag prefixes (example <asp:...)?
2. why doesn't the following code (in VB.NET) render these prefixes?
Dim myTextBox As New System.Web.UI.WebControls.TextBox
Dim oStringWriter As System.IO.StringWriter = New
System.IO.StringWriter
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(oStringWriter)
myTextBox.RenderControl(oHtmlTextWriter)
TextBox1.Text = oStringWriter.ToString()
Regards,
BlazWhat are u trying to do?
Do u want to use ASP.NET or VB?
"Blaz Ziherl" wrote:
> Hi all,
> I have two ASP.NET newby questions:
> 1. what and why are there tag prefixes (example <asp:...)?
> 2. why doesn't the following code (in VB.NET) render these prefixes?
> Dim myTextBox As New System.Web.UI.WebControls.TextBox
> Dim oStringWriter As System.IO.StringWriter = New
> System.IO.StringWriter
> Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
> System.Web.UI.HtmlTextWriter(oStringWriter)
> myTextBox.RenderControl(oHtmlTextWriter)
> TextBox1.Text = oStringWriter.ToString()
>
> Regards,
> Blaz
>
blaz,
Tag prefixes are used by the asp.net compiler to identify tags that should
be processed on the server. All stardard ASP.Net control have the ASP
prefix. If you build your own controls, you can use a custom tag prefix suc
h
as:
<blaz:newlabel id="blazlabel1" runat="server" text="" />
If you notice the rendered HTML output on the client these server controls
have been rendered as standard HTML elements such as <select>, <input>,
<img>, and so forth. Browsers such as IE and Netscape cannot parse a
<asp:label> tag, the server handles this.
For the answer to question 2. What are you trying to do?
Add a text box to a form?
Dim tbFirstName as System.Web.UI.WebControls.TextBox
Page.Controls.Add(FirstName)
Read the text of a textbox?
Dim strFirstName as String = tbFirstName.Text
HTH MikeL
"Blaz Ziherl" wrote:
> Hi all,
> I have two ASP.NET newby questions:
> 1. what and why are there tag prefixes (example <asp:...)?
> 2. why doesn't the following code (in VB.NET) render these prefixes?
> Dim myTextBox As New System.Web.UI.WebControls.TextBox
> Dim oStringWriter As System.IO.StringWriter = New
> System.IO.StringWriter
> Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
> System.Web.UI.HtmlTextWriter(oStringWriter)
> myTextBox.RenderControl(oHtmlTextWriter)
> TextBox1.Text = oStringWriter.ToString()
>
> Regards,
> Blaz
>
Thanks for your answers!
About the rendering. Well I am trying to add an ASP.NET WebControls
support to my application that includes a simple HTML Editor. But
can't really figure out how could I generate <asp:...></asp:...>
formatted ASP code from any of the WebControls.
Any ideas?
Regards,
Blaz