Saturday, March 31, 2012
Table Rows
I have dynamically created a table in ASP.NET using tbl.rows.add(tr)
method where 'tbl' is a System.Web.UI.WebControls.Table. and tr is a
TableRows object.
Any ideas why I can't then itterate through the table object and reference
each of the rows using:
Dim tb as tablesRow
For Each tr In tbl.Rows
xx = tr.Cells(1).Text
Next
There appears to be no rows in the table ie. tbl.tablerows.count = 0
TIA
TimDim t as new table
Page.Controls.Add(t)
Dim r As TableRow
Dim c As TableCell
For i As Int32 = 0 To 5
r = New TableRow
c = New TableCell
c.Text = i.ToString
r.Cells.Add(c)
t.Rows.Add(r)
Next
For Each r In t.Rows
Response.Write("<BR>Cell Value = " & r.Cells(0).Text)
Next
"Tim" <timbryant@.smoothit.co.uk> wrote in message
news:OUr4bISvFHA.2064@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I have dynamically created a table in ASP.NET using tbl.rows.add(tr)
> method where 'tbl' is a System.Web.UI.WebControls.Table. and tr is a
> TableRows object.
> Any ideas why I can't then itterate through the table object and reference
> each of the rows using:
> Dim tb as tablesRow
> For Each tr In tbl.Rows
> xx = tr.Cells(1).Text
> Next
> There appears to be no rows in the table ie. tbl.tablerows.count = 0
> TIA
> Tim
>
>
Tim,
If you are trying to access the rows on postback, note, that you have to
re-create dynamucally created objects in the code.
Eliyahu
"Tim" <timbryant@.smoothit.co.uk> wrote in message
news:OUr4bISvFHA.2064@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I have dynamically created a table in ASP.NET using tbl.rows.add(tr)
> method where 'tbl' is a System.Web.UI.WebControls.Table. and tr is a
> TableRows object.
> Any ideas why I can't then itterate through the table object and reference
> each of the rows using:
> Dim tb as tablesRow
> For Each tr In tbl.Rows
> xx = tr.Cells(1).Text
> Next
> There appears to be no rows in the table ie. tbl.tablerows.count = 0
> TIA
> Tim
>
>
table server control -- make column invisible
that has three columns. Sometimes I need the second column to be invisible,
sometimes the third. How can I set a column to be invisible in code? There
appears to not be a programmatic way to work with columns in the way that
there is rows.
Thanks.
--SusanI don't think there a Column Visible property for the WebControls.Table object. So you may have to handle this on your own
For example
foreach(TableRow tr in myTable.Rows
tr.Cells[yourcolumnindex].Visible = false
HTH
Suresh
-- Susan Geller wrote: --
I have a table server control (System.Web.UI.WebControls.Table) on my for
that has three columns. Sometimes I need the second column to be invisible
sometimes the third. How can I set a column to be invisible in code? Ther
appears to not be a programmatic way to work with columns in the way tha
there is rows
Thanks
--Susa
Table Web Control
I've completed the table on load, and all of the checkbox controls load up as expected, however I now need to submit any changes based on the users values. I've been googling for a good article on the Table web control but haven't found anything that will help. Does anyone know of any articles, or have sample code for maintaining state of these controls and iterating through them so I can create my dynamic SQL based on selections?
Thanks.From the SDK:
"Note: Programmatic additions or modifications to a table row or cell will not persist across posts to the server. Table rows and cells are controls of their own, not properties of the Table control. Changes to table rows or cells must be reconstructed after each post to the server."
Ok, so I think that answers my viewstate problem. I DO recreate this table on page load everytime, so I don't think I need to worry about that.
Any help on muddling through the selected checkboxes of a dynamically created table web control, would still be very beneficial to my cause.
Ugh, I'm fried here...
The viewstate will STILL be a problem, because I wasn't thinking that with each postback, my table would just be re-created, therefore I won't get the modified values on submission.
I keep talking to myself but oh well...
Just to reiterate, I need help on maintaing state for a dynamically created table web control, and how to iterate through the controls that were created in that table on postback.
Dear Forum,
Hi! It's me again!
Ok, so after a little more research I found that people are suggesting the Request.Form() to collect information about the controls. Does that sound right? I guess if you can't take advantage of viewstate in this situation, then Request.Form() is the way to go.
Taking that into consideration, I don't think I can really "iterate" through the controls in my dynamic table, but maybe create some variables that will hold the number of checkbox controls say, when I create the table. So maybe it would look something like this:
pseudocode -
' Creating the table
Dim cb as CheckBox
Dim cbCounter as Int32
'Dynamically create checkbox here and increment the checkbox counter
Then later when I retireve the values within my table...
'Go through each of the checkboxes and determine the value
for x=0 to cbCounter.Length - 1
'check the value of checkbox "x" here
Does this sound like a logical resolution? Am I taking this too far and there is an easier path that I'm missing here? Does anyone really care at this point? :)
Hi FrankWhite,
I'm having the same problem here. I'm fetching values from a MySQL database, I show them in a nice table with checkboxes. But when the user clicks "submit" my checkboxes are lost (since my table won't keep them).
So I'm looking for the same solution: how can I keep all generated checkboxes, so I can check which of them are checked by the user?
If someone has experience with this scenario and knows how it can be done, please post it here for me and FrankWhite ;)
Thanks in advance!
1. Try to stay away from dynamically creating controls that need to keep their values during postbacks.
2. Modify the way you search for information. More than 50% of programming involves just trying to find out how to do stuff. Your problem is not with viewstate, but with the ASP.NET lifecycle.
To answer both your question, you will need some patients.This article will answer your questions, but you have to read every word carefully. DONT skip to the end and read the conclusion as you will miss out on important things that you should learn.
Jagdip
(Haven't read the article yet)
I did come to a solution the other day. Basically on Page_Load my table is recreated everytime. When the submit button is pressed, I simply do Request.Form() on the checkbox controls. I don't have the code in front of me at the moment, but I basically did the following to solve my problem.
1.) Created a variable that would serve as a counter for my checkboxes.
2.) When the checkbox was created, I would give it the id: "chk_" & chkCtrls (variable that was the counter)
3.) In the btn_submit() I created a loop to iterate through each of the checkbox controls (well not really the controls, rather the # of controls). In the loop I would check if the checkbox was checked and do something according to that:
for x = 0 to chkCtrls
if Request.Form("chk_" & x) = "On" Then
'do something
end if
next
There was a lot more to it then this for my situation, but I think this will give you a good idea. Let me know if this helps, or if you figured out a different solution. In the meantime, I'll need to peep this article...
I used the same solution, I recreated my checkbox collection each time in Page_load, and used Request.Form to check wether the "check all" was checked or unchecked to set a default checked value on each checkbox (true/false). Then on the submit button I used Request.Form again to check the status of each generated checkbox by checking for controls like "chk" + intID.
This does the trick I needed very well.
I'll take a look at the article as well, in case this is not the right way of programming this :)
Thanks for the help,
Speerman
Alright, alright, I'll give you the jist of it. I'm not an expert in this (just been reading around a lot) so here goes.
Basically, the ASP.NET life cylce loads your info like this:
Page_Init
Load ViewState
Page_Load
Run any controls functions (e.g. button_click functions, etc.)
From this you can see that if you create controls dynamically, then they will be displayed on the page; but their viewstate will not be 'loaded'. What we need is a way to create the controls before the Load Viewstate state.
Solution: If you are using VS, the you know there is a region called " Web Form Designer Generated Code ". In this you will find:
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
All you need to do is call the function that creates the dynamic controls from within the Page_Init function. That's it (i think - havent got a chance to try it).
But please, read the article. You will have a better understanding of ASP.NET which means better pages (and maybe a pay rise - you can tell why I read the aticles ;-)
HTH
Jagdip
Table? Frameset or User control?
I am new with ASP and now developing a web application that having two navigation menu.One is at left and another is at top side. When a user click a hyperlink at left, the top navigation menu will change according the hyperlinks at left. And when the user click the hyperlink at top, it will display the required page at bottom right hand side.
I have no idea whether the navigation menu develop as frame, table or user control. Can anyone sharing your opinion? Thanks.Hello, the menu should be a usercontrol, and you should have a look at this page to know how to setp up your pages:
Master Pages
regards
Wednesday, March 28, 2012
TableAdapters and web.config
this from a web application. Is there a way of getting the TableAdapters to
use the connectionstrings defined in web.config.
From the MSDN documentation it seems like it's possible to override settings
with values in a config file for winform applications. Is the same possible
for web applications.
I have tried to add a connectionstring (under the connectionstring section)
in web.config with the same name as the name in the setting file. The
connectionstring in web.config points to a database that doesn't contain the
required schema. Since I'm not getting any errors and things are still
working, I assume it is still using the default connectionstring supplied at
designtime.Hi Kimbell,
Welcome to ASP.NET newsgroup.
Regarding on the configuration issue you mentioned when using TableAdapter
from class library in asp.net 2.0 project, I've also met this problem
before. Yes, as you has mentioned, when we has build the
DataSet/TableAdapter in class library project, the TableAdapter's
Connection /ConnectionString setting is persisted in the classlibrary
assembly's content so that when referenced in asp.net 2.0 project, it won't
use the web.config file's info (but still use the one persisted at
design-time in classlibrary project). Based on my research, as for the
Project Settings, the asp.net 2.0 seems has different support from winform
project. Currently one approach is manually modify the TableAdapter's
design-time generated code in the Classlibrary project. for example:
the TAbleAdapter's autogenerate code is as below, the "InitConnection"
function is just the one which supply connectionstring and constructing the
Connection instance for the TableAdapter
=============================
private void InitConnection()
{
this.m_connection = new System.Data.SqlClient.SqlConnection();
this.m_connection.ConnectionString =
DSLibrary.Properties.Settings.Default.NorthwindCon nectionString;
}
which retrieve the connection string through Project's Properties.Settings
collection. We can modify it to the following one:
======================
Object obj =
System.Configuration.ConfigurationSettings.GetConf ig("connectionStrings");
ConnectionStringsSection css = obj as ConnectionStringsSection;
string connstr =
css.ConnectionStrings["LocalNorthwindConnStr"].ConnectionString;
this.m_connection = new System.Data.SqlClient.SqlConnection();
this.m_connection.ConnectionString = connstr;
=====================
so that it will retrieve the info from the final hosting application's
application config file (appconfig or web.config).
Hope helps. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
-------
| Thread-Topic: TableAdapters and web.config
| thread-index: AcXNckyfTDC6JTskQe231gX8p+7Y9A==
| X-WBNR-Posting-Host: 195.139.24.170
| From: "=?Utf-8?B?Q2hyaXN0b3BoZXIgS2ltYmVsbA==?="
<c_kimbell@.newsgroup.nospam>
| Subject: TableAdapters and web.config
| Date: Mon, 10 Oct 2005 01:12:04 -0700
| Lines: 15
| Message-ID: <69C48290-408C-4942-9F61-3C909A6766E3@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:349611
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have a class library that contains a number of TableAdapters and I'm
using
| this from a web application. Is there a way of getting the TableAdapters
to
| use the connectionstrings defined in web.config.
|
| From the MSDN documentation it seems like it's possible to override
settings
| with values in a config file for winform applications. Is the same
possible
| for web applications.
|
| I have tried to add a connectionstring (under the connectionstring
section)
| in web.config with the same name as the name in the setting file. The
| connectionstring in web.config points to a database that doesn't contain
the
| required schema. Since I'm not getting any errors and things are still
| working, I assume it is still using the default connectionstring supplied
at
| designtime.
|
|
So what you are recommending is to change the autogenerated code?
What about the following warning at the top of the file:
"Changes to this file may cause incorrect behavior and will be lost if the
code is regenerated."
Particularly the statement about lost changes.
I think a better approach is to change the ConnectionModifier to public in
the designer; then set the connectionstring from code.
I was hoping for a more elegant solution since Microsoft has put some work
into this settings system. Maybe in the next version.
"Steven Cheng[MSFT]" wrote:
> Hi Kimbell,
> Welcome to ASP.NET newsgroup.
> Regarding on the configuration issue you mentioned when using TableAdapter
> from class library in asp.net 2.0 project, I've also met this problem
> before. Yes, as you has mentioned, when we has build the
> DataSet/TableAdapter in class library project, the TableAdapter's
> Connection /ConnectionString setting is persisted in the classlibrary
> assembly's content so that when referenced in asp.net 2.0 project, it won't
> use the web.config file's info (but still use the one persisted at
> design-time in classlibrary project). Based on my research, as for the
> Project Settings, the asp.net 2.0 seems has different support from winform
> project. Currently one approach is manually modify the TableAdapter's
> design-time generated code in the Classlibrary project. for example:
> the TAbleAdapter's autogenerate code is as below, the "InitConnection"
> function is just the one which supply connectionstring and constructing the
> Connection instance for the TableAdapter
> =============================
> private void InitConnection()
> {
> this.m_connection = new System.Data.SqlClient.SqlConnection();
> this.m_connection.ConnectionString =
> DSLibrary.Properties.Settings.Default.NorthwindCon nectionString;
> }
> which retrieve the connection string through Project's Properties.Settings
> collection. We can modify it to the following one:
> ======================
> Object obj =
> System.Configuration.ConfigurationSettings.GetConf ig("connectionStrings");
> ConnectionStringsSection css = obj as ConnectionStringsSection;
> string connstr =
> css.ConnectionStrings["LocalNorthwindConnStr"].ConnectionString;
> this.m_connection = new System.Data.SqlClient.SqlConnection();
> this.m_connection.ConnectionString = connstr;
> =====================
> so that it will retrieve the info from the final hosting application's
> application config file (appconfig or web.config).
> Hope helps. Thanks,
> Steven Cheng
> Microsoft Online Support
Thanks for your response Kimbell,
Yes, the
========
"Changes to this file may cause incorrect behavior and will be lost if the
code is regenerated."
========
you mentioned is really a potential problem with my workaround. And your
appoarch on changing the ConnectionModifer to public is OK for
programmatical accessing. However, in most cases of ASP.NET 2.0 web
application, we will use design-time ObjectDataSource control to reference
the TableAdpater, and this is done through IDE interactively no code is
involved. So in such scenario, we may need to predefined the connection's
initilization in TableAdapter's code.
Anyway, I really appreciate your advice on the configuration setttings ,
and since this is a new feature involved in 2.0, I think it'll be improved
in the sequential versions so as to ease the component, class library
developing and seamless integrated into
front end applications.
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
-------
| Thread-Topic: TableAdapters and web.config
| thread-index: AcXOO+CVs5sRlZYtRh+M2u+nQzNUBg==
| X-WBNR-Posting-Host: 195.139.24.170
| From: "=?Utf-8?B?Q2hyaXN0b3BoZXIgS2ltYmVsbA==?="
<c_kimbell@.newsgroup.nospam>
| References: <69C48290-408C-4942-9F61-3C909A6766E3@.microsoft.com>
<o4v8pDhzFHA.3712@.TK2MSFTNGXA02.phx.gbl>
| Subject: RE: TableAdapters and web.config
| Date: Tue, 11 Oct 2005 01:15:01 -0700
| Lines: 68
| Message-ID: <EAC2EB76-0E98-4837-AD33-55A57F82A6EA@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:349877
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| So what you are recommending is to change the autogenerated code?
| What about the following warning at the top of the file:
|
| "Changes to this file may cause incorrect behavior and will be lost if
the
| code is regenerated."
|
| Particularly the statement about lost changes.
|
| I think a better approach is to change the ConnectionModifier to public
in
| the designer; then set the connectionstring from code.
|
| I was hoping for a more elegant solution since Microsoft has put some
work
| into this settings system. Maybe in the next version.
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Kimbell,
| >
| > Welcome to ASP.NET newsgroup.
| > Regarding on the configuration issue you mentioned when using
TableAdapter
| > from class library in asp.net 2.0 project, I've also met this problem
| > before. Yes, as you has mentioned, when we has build the
| > DataSet/TableAdapter in class library project, the TableAdapter's
| > Connection /ConnectionString setting is persisted in the classlibrary
| > assembly's content so that when referenced in asp.net 2.0 project, it
won't
| > use the web.config file's info (but still use the one persisted at
| > design-time in classlibrary project). Based on my research, as for the
| > Project Settings, the asp.net 2.0 seems has different support from
winform
| > project. Currently one approach is manually modify the TableAdapter's
| > design-time generated code in the Classlibrary project. for example:
| >
| > the TAbleAdapter's autogenerate code is as below, the "InitConnection"
| > function is just the one which supply connectionstring and constructing
the
| > Connection instance for the TableAdapter
| >
| > =============================
| > private void InitConnection()
| > {
| > this.m_connection = new System.Data.SqlClient.SqlConnection();
| > this.m_connection.ConnectionString =
| > DSLibrary.Properties.Settings.Default.NorthwindCon nectionString;
| > }
| >
| > which retrieve the connection string through Project's
Properties.Settings
| > collection. We can modify it to the following one:
| >
| > ======================
| >
| > Object obj =
| >
System.Configuration.ConfigurationSettings.GetConf ig("connectionStrings");
| > ConnectionStringsSection css = obj as ConnectionStringsSection;
| > string connstr =
| > css.ConnectionStrings["LocalNorthwindConnStr"].ConnectionString;
| > this.m_connection = new System.Data.SqlClient.SqlConnection();
| > this.m_connection.ConnectionString = connstr;
| >
| > =====================
| >
| > so that it will retrieve the info from the final hosting application's
| > application config file (appconfig or web.config).
| >
| > Hope helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
|
|
TableAdapters and web.config
this from a web application. Is there a way of getting the TableAdapters to
use the connectionstrings defined in web.config.
From the MSDN documentation it seems like it's possible to override settings
with values in a config file for winform applications. Is the same possible
for web applications.
I have tried to add a connectionstring (under the connectionstring section)
in web.config with the same name as the name in the setting file. The
connectionstring in web.config points to a database that doesn't contain the
required schema. Since I'm not getting any errors and things are still
working, I assume it is still using the default connectionstring supplied at
designtime.Hi Kimbell,
Welcome to ASP.NET newsgroup.
Regarding on the configuration issue you mentioned when using TableAdapter
from class library in asp.net 2.0 project, I've also met this problem
before. Yes, as you has mentioned, when we has build the
DataSet/TableAdapter in class library project, the TableAdapter's
Connection /ConnectionString setting is persisted in the classlibrary
assembly's content so that when referenced in asp.net 2.0 project, it won't
use the web.config file's info (but still use the one persisted at
design-time in classlibrary project). Based on my research, as for the
Project Settings, the asp.net 2.0 seems has different support from winform
project. Currently one approach is manually modify the TableAdapter's
design-time generated code in the Classlibrary project. for example:
the TAbleAdapter's autogenerate code is as below, the "InitConnection"
function is just the one which supply connectionstring and constructing the
Connection instance for the TableAdapter
=============================
private void InitConnection()
{
this.m_connection = new System.Data.SqlClient.SqlConnection();
this.m_connection.ConnectionString =
DSLibrary.Properties.Settings.Default.NorthwindConnectionString;
}
which retrieve the connection string through Project's Properties.Settings
collection. We can modify it to the following one:
======================
Object obj =
System.Configuration.ConfigurationSettings.GetConfig("connectionStrings");
ConnectionStringsSection css = obj as ConnectionStringsSection;
string connstr =
css.ConnectionStrings["LocalNorthwindConnStr"].ConnectionString;
this.m_connection = new System.Data.SqlClient.SqlConnection();
this.m_connection.ConnectionString = connstr;
=====================
so that it will retrieve the info from the final hosting application's
application config file (appconfig or web.config).
Hope helps. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
| Thread-Topic: TableAdapters and web.config
| thread-index: AcXNckyfTDC6JTskQe231gX8p+7Y9A==
| X-WBNR-Posting-Host: 195.139.24.170
| From: "examnotes"
<c_kimbell@.newsgroup.nospam>
| Subject: TableAdapters and web.config
| Date: Mon, 10 Oct 2005 01:12:04 -0700
| Lines: 15
| Message-ID: <69C48290-408C-4942-9F61-3C909A6766E3@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:349611
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have a class library that contains a number of TableAdapters and I'm
using
| this from a web application. Is there a way of getting the TableAdapters
to
| use the connectionstrings defined in web.config.
|
| From the MSDN documentation it seems like it's possible to override
settings
| with values in a config file for winform applications. Is the same
possible
| for web applications.
|
| I have tried to add a connectionstring (under the connectionstring
section)
| in web.config with the same name as the name in the setting file. The
| connectionstring in web.config points to a database that doesn't contain
the
| required schema. Since I'm not getting any errors and things are still
| working, I assume it is still using the default connectionstring supplied
at
| designtime.
|
|
So what you are recommending is to change the autogenerated code?
What about the following warning at the top of the file:
"Changes to this file may cause incorrect behavior and will be lost if the
code is regenerated."
Particularly the statement about lost changes.
I think a better approach is to change the ConnectionModifier to public in
the designer; then set the connectionstring from code.
I was hoping for a more elegant solution since Microsoft has put some work
into this settings system. Maybe in the next version.
"Steven Cheng[MSFT]" wrote:
> Hi Kimbell,
> Welcome to ASP.NET newsgroup.
> Regarding on the configuration issue you mentioned when using TableAdapter
> from class library in asp.net 2.0 project, I've also met this problem
> before. Yes, as you has mentioned, when we has build the
> DataSet/TableAdapter in class library project, the TableAdapter's
> Connection /ConnectionString setting is persisted in the classlibrary
> assembly's content so that when referenced in asp.net 2.0 project, it won'
t
> use the web.config file's info (but still use the one persisted at
> design-time in classlibrary project). Based on my research, as for the
> Project Settings, the asp.net 2.0 seems has different support from winform
> project. Currently one approach is manually modify the TableAdapter's
> design-time generated code in the Classlibrary project. for example:
> the TAbleAdapter's autogenerate code is as below, the "InitConnection"
> function is just the one which supply connectionstring and constructing th
e
> Connection instance for the TableAdapter
> =============================
> private void InitConnection()
> {
> this.m_connection = new System.Data.SqlClient.SqlConnection();
> this.m_connection.ConnectionString =
> DSLibrary.Properties.Settings.Default.NorthwindConnectionString;
> }
> which retrieve the connection string through Project's Properties.Setting
s
> collection. We can modify it to the following one:
> ======================
> Object obj =
> System.Configuration.ConfigurationSettings.GetConfig("connectionStrings");
> ConnectionStringsSection css = obj as ConnectionStringsSection;
> string connstr =
> css.ConnectionStrings["LocalNorthwindConnStr"].ConnectionString;
> this.m_connection = new System.Data.SqlClient.SqlConnection();
> this.m_connection.ConnectionString = connstr;
> =====================
> so that it will retrieve the info from the final hosting application's
> application config file (appconfig or web.config).
> Hope helps. Thanks,
> Steven Cheng
> Microsoft Online Support
>
Thanks for your response Kimbell,
Yes, the
========
"Changes to this file may cause incorrect behavior and will be lost if the
code is regenerated."
========
you mentioned is really a potential problem with my workaround. And your
appoarch on changing the ConnectionModifer to public is OK for
programmatical accessing. However, in most cases of ASP.NET 2.0 web
application, we will use design-time ObjectDataSource control to reference
the TableAdpater, and this is done through IDE interactively no code is
involved. So in such scenario, we may need to predefined the connection's
initilization in TableAdapter's code.
Anyway, I really appreciate your advice on the configuration setttings ,
and since this is a new feature involved in 2.0, I think it'll be improved
in the sequential versions so as to ease the component, class library
developing and seamless integrated into
front end applications.
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
--
| Thread-Topic: TableAdapters and web.config
| thread-index: AcXOO+CVs5sRlZYtRh+M2u+nQzNUBg==
| X-WBNR-Posting-Host: 195.139.24.170
| From: "examnotes"
<c_kimbell@.newsgroup.nospam>
| References: <69C48290-408C-4942-9F61-3C909A6766E3@.microsoft.com>
<o4v8pDhzFHA.3712@.TK2MSFTNGXA02.phx.gbl>
| Subject: RE: TableAdapters and web.config
| Date: Tue, 11 Oct 2005 01:15:01 -0700
| Lines: 68
| Message-ID: <EAC2EB76-0E98-4837-AD33-55A57F82A6EA@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:349877
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| So what you are recommending is to change the autogenerated code?
| What about the following warning at the top of the file:
|
| "Changes to this file may cause incorrect behavior and will be lost if
the
| code is regenerated."
|
| Particularly the statement about lost changes.
|
| I think a better approach is to change the ConnectionModifier to public
in
| the designer; then set the connectionstring from code.
|
| I was hoping for a more elegant solution since Microsoft has put some
work
| into this settings system. Maybe in the next version.
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Kimbell,
| >
| > Welcome to ASP.NET newsgroup.
| > Regarding on the configuration issue you mentioned when using
TableAdapter
| > from class library in asp.net 2.0 project, I've also met this problem
| > before. Yes, as you has mentioned, when we has build the
| > DataSet/TableAdapter in class library project, the TableAdapter's
| > Connection /ConnectionString setting is persisted in the classlibrary
| > assembly's content so that when referenced in asp.net 2.0 project, it
won't
| > use the web.config file's info (but still use the one persisted at
| > design-time in classlibrary project). Based on my research, as for the
| > Project Settings, the asp.net 2.0 seems has different support from
winform
| > project. Currently one approach is manually modify the TableAdapter's
| > design-time generated code in the Classlibrary project. for example:
| >
| > the TAbleAdapter's autogenerate code is as below, the "InitConnection"
| > function is just the one which supply connectionstring and constructing
the
| > Connection instance for the TableAdapter
| >
| > =============================
| > private void InitConnection()
| > {
| > this.m_connection = new System.Data.SqlClient.SqlConnection();
| > this.m_connection.ConnectionString =
| > DSLibrary.Properties.Settings.Default.NorthwindConnectionString;
| > }
| >
| > which retrieve the connection string through Project's
Properties.Settings
| > collection. We can modify it to the following one:
| >
| > ======================
| >
| > Object obj =
| >
System.Configuration.ConfigurationSettings.GetConfig("connectionStrings");
| > ConnectionStringsSection css = obj as ConnectionStringsSection;
| > string connstr =
| > css.ConnectionStrings["LocalNorthwindConnStr"].ConnectionString;
| > this.m_connection = new System.Data.SqlClient.SqlConnection();
| > this.m_connection.ConnectionString = connstr;
| >
| > =====================
| >
| > so that it will retrieve the info from the final hosting application's
| > application config file (appconfig or web.config).
| >
| > Hope helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
|
|
TableCaptionAlign Enum missing in Same Version of two System.Web.D
System.Web.Dll contains a enum System.Web.UI.WebControls.TableCaptionAlign
and the other did not. I have development a functionality which was not
working in some of the machines and on diggin' into, i found this. I also
compare the 2 dlls through ILDisassembler. Can anyone explain me WHY, WHICH
one should i use?I believe SP1 introduced the new type...
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:68A461A9-9DCA-42C0-8795-BC657BF2C6ED@.microsoft.com...
> I have 2 System.Web.dll taken from 2 different machines, one of the
> System.Web.Dll contains a enum System.Web.UI.WebControls.TableCaptionAlign
> and the other did not. I have development a functionality which was not
> working in some of the machines and on diggin' into, i found this. I also
> compare the 2 dlls through ILDisassembler. Can anyone explain me WHY,
WHICH
> one should i use?
TableCaptionAlign Enum missing in Same Version of two System.Web.D
System.Web.Dll contains a enum System.Web.UI.WebControls.TableCaptionAlign
and the other did not. I have development a functionality which was not
working in some of the machines and on diggin' into, i found this. I also
compare the 2 dlls through ILDisassembler. Can anyone explain me WHY, WHICH
one should i use?I believe SP1 introduced the new type...
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:68A461A9-9DCA-42C0-8795-BC657BF2C6ED@.microsoft.com...
> I have 2 System.Web.dll taken from 2 different machines, one of the
> System.Web.Dll contains a enum System.Web.UI.WebControls.TableCaptionAlign
> and the other did not. I have development a functionality which was not
> working in some of the machines and on diggin' into, i found this. I also
> compare the 2 dlls through ILDisassembler. Can anyone explain me WHY,
WHICH
> one should i use?
TableRow/TableCell Serverside Q
<asp:Table>
<asp:TableRow>
<asp:TableCell>
<asp:Table>
<asp:TableRow>
<asp:TableCell></asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
</asp:Table>
</asp:TableCell>
</asp:TableRow>
</asp:Table
How can I construct this on the server side? Assume that I start with an
empty asp:table control on my webform, as follows:
<asp:Table ID="tblViewWall" Runat="server"></asp:Table
I've done the following:
TableRow trRow = new TableRow();
TableCell trCell = new TableCell();
trRow.Cells.Add(trCell);
// Now inside trCell, I want to add another table with 1 row, and two
cells
// I can't see how I would create another Table, and add it to a
TableCell
tblViewWall.Rows.Add(trRow);Figured it out.
tcCell.Controls.Add( ...)
"George Durzi" <gdurzi@.hotmail.com> wrote in message
news:#tWpeZ8oDHA.2456@.TK2MSFTNGP09.phx.gbl...
> Consider this pseudo HTML from a web form
> <asp:Table>
> <asp:TableRow>
> <asp:TableCell>
> <asp:Table>
> <asp:TableRow>
> <asp:TableCell></asp:TableCell>
> <asp:TableCell></asp:TableCell>
> </asp:TableRow>
> </asp:Table>
> </asp:TableCell>
> </asp:TableRow>
> </asp:Table>
> How can I construct this on the server side? Assume that I start with an
> empty asp:table control on my webform, as follows:
> <asp:Table ID="tblViewWall" Runat="server"></asp:Table>
> I've done the following:
> TableRow trRow = new TableRow();
> TableCell trCell = new TableCell();
> trRow.Cells.Add(trCell);
> // Now inside trCell, I want to add another table with 1 row, and two
> cells
> // I can't see how I would create another Table, and add it to a
> TableCell
> tblViewWall.Rows.Add(trRow);
George,
Try something like this:
TableCell newCell = new TableCell();
Table childTable = new Table();
newCell.Controls.Add(childTable);
//Populate the child table here.
TableRow newRow = new TableRow();
newRow.Cells.Add(newCell);
this.tblViewWall.Rows.Add(newRow);
HTH,
Nicole
"George Durzi" <gdurzi@.hotmail.com> wrote in message
news:%23tWpeZ8oDHA.2456@.TK2MSFTNGP09.phx.gbl...
> Consider this pseudo HTML from a web form
> <asp:Table>
> <asp:TableRow>
> <asp:TableCell>
> <asp:Table>
> <asp:TableRow>
> <asp:TableCell></asp:TableCell>
> <asp:TableCell></asp:TableCell>
> </asp:TableRow>
> </asp:Table>
> </asp:TableCell>
> </asp:TableRow>
> </asp:Table>
> How can I construct this on the server side? Assume that I start with an
> empty asp:table control on my webform, as follows:
> <asp:Table ID="tblViewWall" Runat="server"></asp:Table>
> I've done the following:
> TableRow trRow = new TableRow();
> TableCell trCell = new TableCell();
> trRow.Cells.Add(trCell);
> // Now inside trCell, I want to add another table with 1 row, and two
> cells
> // I can't see how I would create another Table, and add it to a
> TableCell
> tblViewWall.Rows.Add(trRow);
Tables
I'm hasving trouble with tables in Visual Web Developer Express.
I've set cellspacing and cellpadding to zero, but there's spaces around
objects in my table.
Any idea what's going wrong?Hi
Check whether you have assigned some width for every table cell (<td>),
which is giving you this experience. Try to set the width as zero and see how
it appears.
Prem
Newbie here.
Quote:
Originally Posted by
>
I'm hasving trouble with tables in Visual Web Developer Express.
>
I've set cellspacing and cellpadding to zero, but there's spaces around
objects in my table.
>
Any idea what's going wrong?
Where do you see those spaces? In the designer or in the resulting
webpage in the browser?
The designer might show spaces (and borders) to make the layout clear.
If in the browser, check the resulting html code ("view source") to see
if you can find a reason for those spaces there.
Hans Kesting
Tables and CSS
Not sure if this is the right forum for this, but here goes:
I'm using VS.NET 2003 to create a Web app and have defined a table as
follows:
<table border=3 bordercolordark="#006699" bordercolorlight="lightgrey"
width="100%">
As I'm going to be reusing this style all over the app, I'm trying to
replace it with a style, as follows:
<table class=tblBorder>
and in my stylesheet I have the following definition:
.tblBorder
{
border-style: outset;
border-bottom-color: "#006699";
border-right-color: "#006699";
border-left-color: "lightgrey";
border-top-color: "lightgrey";
border-width: 3;
}
But it doesn't look right. I'm obviously missing something...
Any assistance gratefully received.
Mark RaeHi Mark,
You aren't missing anything. The bordercolorlight and bordercolordark are
rendered differently than CSS styles are so things may not look the same
when applied differently. Also, border in the <table> tag is expressed
differently than border-width is in CSS (border-width in CSS can take
different measurement units including pt, px, em, etc). You will have to toy
around with your CSS settings to get them closer to what the browser
actually renders if those values were supplied in the tag.
HTH
Kyril Magnos
Question of the day:
What is Mono?
A) Disease where the lymph nodes become swollen.
B) A single sound
C) A synonym for one
D) A port of .NET meant to royally irritate MSFT
E) All of the above.
"Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%23JEFeE3aEHA.3512@.TK2MSFTNGP12.phx.gbl...
| Hi,
|
| Not sure if this is the right forum for this, but here goes:
|
| I'm using VS.NET 2003 to create a Web app and have defined a table as
| follows:
|
| <table border=3 bordercolordark="#006699" bordercolorlight="lightgrey"
| width="100%">
|
| As I'm going to be reusing this style all over the app, I'm trying to
| replace it with a style, as follows:
|
| <table class=tblBorder>
|
| and in my stylesheet I have the following definition:
|
| .tblBorder
| {
| border-style: outset;
| border-bottom-color: "#006699";
| border-right-color: "#006699";
| border-left-color: "lightgrey";
| border-top-color: "lightgrey";
| border-width: 3;
| }
|
| But it doesn't look right. I'm obviously missing something...
|
| Any assistance gratefully received.
|
| Mark Rae
|
|
"Kyril Magnos" <kyril.magnos@.yahoo.com> wrote in message
news:eHTGrL3aEHA.4048@.TK2MSFTNGP10.phx.gbl...
> Hi Mark,
> You aren't missing anything. The bordercolorlight and bordercolordark are
> rendered differently than CSS styles are so things may not look the same
> when applied differently. Also, border in the <table> tag is expressed
> differently than border-width is in CSS (border-width in CSS can take
> different measurement units including pt, px, em, etc). You will have to
toy
> around with your CSS settings to get them closer to what the browser
> actually renders if those values were supplied in the tag.
OK - thanks for the reply.
Check out
http://www.somacon.com/color/html_c...rder_styles.php
Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%23JEFeE3aEHA.3512@.TK2MSFTNGP12.phx.gbl...
> Hi,
> Not sure if this is the right forum for this, but here goes:
> I'm using VS.NET 2003 to create a Web app and have defined a table as
> follows:
> <table border=3 bordercolordark="#006699" bordercolorlight="lightgrey"
> width="100%">
> As I'm going to be reusing this style all over the app, I'm trying to
> replace it with a style, as follows:
> <table class=tblBorder>
> and in my stylesheet I have the following definition:
> .tblBorder
> {
> border-style: outset;
> border-bottom-color: "#006699";
> border-right-color: "#006699";
> border-left-color: "lightgrey";
> border-top-color: "lightgrey";
> border-width: 3;
> }
> But it doesn't look right. I'm obviously missing something...
> Any assistance gratefully received.
> Mark Rae
>
"Alphonse Giambrone" <NOSPAMa-giam@.example.invalid> wrote in message
news:emevqZ4aEHA.2056@.TK2MSFTNGP12.phx.gbl...
> Check out
> http://www.somacon.com/color/html_c...rder_styles.php
A useful link - thanks very much.
Tables and CSS
Not sure if this is the right forum for this, but here goes:
I'm using VS.NET 2003 to create a Web app and have defined a table as
follows:
<table border=3 bordercolordark="#006699" bordercolorlight="lightgrey"
width="100%"
As I'm going to be reusing this style all over the app, I'm trying to
replace it with a style, as follows:
<table class=tblBorder
and in my stylesheet I have the following definition:
..tblBorder
{
border-style: outset;
border-bottom-color: "#006699";
border-right-color: "#006699";
border-left-color: "lightgrey";
border-top-color: "lightgrey";
border-width: 3;
}
But it doesn't look right. I'm obviously missing something...
Any assistance gratefully received.
Mark RaeHi Mark,
You aren't missing anything. The bordercolorlight and bordercolordark are
rendered differently than CSS styles are so things may not look the same
when applied differently. Also, border in the <table> tag is expressed
differently than border-width is in CSS (border-width in CSS can take
different measurement units including pt, px, em, etc). You will have to toy
around with your CSS settings to get them closer to what the browser
actually renders if those values were supplied in the tag.
--
HTH
Kyril Magnos
Question of the day:
What is Mono?
A) Disease where the lymph nodes become swollen.
B) A single sound
C) A synonym for one
D) A port of .NET meant to royally irritate MSFT
E) All of the above.
"Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%23JEFeE3aEHA.3512@.TK2MSFTNGP12.phx.gbl...
| Hi,
|
| Not sure if this is the right forum for this, but here goes:
|
| I'm using VS.NET 2003 to create a Web app and have defined a table as
| follows:
|
| <table border=3 bordercolordark="#006699" bordercolorlight="lightgrey"
| width="100%">
|
| As I'm going to be reusing this style all over the app, I'm trying to
| replace it with a style, as follows:
|
| <table class=tblBorder>
|
| and in my stylesheet I have the following definition:
|
| .tblBorder
| {
| border-style: outset;
| border-bottom-color: "#006699";
| border-right-color: "#006699";
| border-left-color: "lightgrey";
| border-top-color: "lightgrey";
| border-width: 3;
| }
|
| But it doesn't look right. I'm obviously missing something...
|
| Any assistance gratefully received.
|
| Mark Rae
|
|
"Kyril Magnos" <kyril.magnos@.yahoo.com> wrote in message
news:eHTGrL3aEHA.4048@.TK2MSFTNGP10.phx.gbl...
> Hi Mark,
> You aren't missing anything. The bordercolorlight and bordercolordark are
> rendered differently than CSS styles are so things may not look the same
> when applied differently. Also, border in the <table> tag is expressed
> differently than border-width is in CSS (border-width in CSS can take
> different measurement units including pt, px, em, etc). You will have to
toy
> around with your CSS settings to get them closer to what the browser
> actually renders if those values were supplied in the tag.
OK - thanks for the reply.
Check out
http://www.somacon.com/color/html_c...rder_styles.php
--
Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%23JEFeE3aEHA.3512@.TK2MSFTNGP12.phx.gbl...
> Hi,
> Not sure if this is the right forum for this, but here goes:
> I'm using VS.NET 2003 to create a Web app and have defined a table as
> follows:
> <table border=3 bordercolordark="#006699" bordercolorlight="lightgrey"
> width="100%">
> As I'm going to be reusing this style all over the app, I'm trying to
> replace it with a style, as follows:
> <table class=tblBorder>
> and in my stylesheet I have the following definition:
> .tblBorder
> {
> border-style: outset;
> border-bottom-color: "#006699";
> border-right-color: "#006699";
> border-left-color: "lightgrey";
> border-top-color: "lightgrey";
> border-width: 3;
> }
> But it doesn't look right. I'm obviously missing something...
> Any assistance gratefully received.
> Mark Rae
"Alphonse Giambrone" <NOSPAMa-giam@.example.invalid> wrote in message
news:emevqZ4aEHA.2056@.TK2MSFTNGP12.phx.gbl...
> Check out
> http://www.somacon.com/color/html_c...rder_styles.php
A useful link - thanks very much.
Monday, March 26, 2012
Tables from web Matrix project to hosting provider
My question is how do I transfer the tables developed in the 'Data' tab to my web host.
There appears no obvious procedure?
Any info appreciated!Hello, what u need to do is use DTS, which comes with the SQL Server client tools. This tool will sort of back up ur data to transfer ur database to the server.
tables in asp.net
Yup. You'll also find that different browsers will display differently as well. You can live with it, control the layout precisely with specific width and height attributes as well as font sizing and hope it works in most browser, or work with CSS instead of tables. But it's the nature of the environment, you don't control what the user sees, the user and the user's browser does.
Jeff
i would have loved the older way. ie coding it and not using the design way. so that u get a better control of where you want to put the control
Tablet PC for ASP.NET Development
I want to replace my old laptop PC with a Tablet PC. I'mwondering if Tablet PC Windows XP has IIS and similar web developmentfeatures activated like in Window XP Pro?
I'm hoping that I can use the Tablet PC to develop my ASP.NET webapplications on the go, just as I currently do on my laptop with XPPro. Does anyone have experience developing on a Tablet PC? If so, any major drawbacks?
I know this isn't the ideal setup. I have a desktop PC that I usefor day-to-day development work...the Tablet PC would be my secondcomputer that'd I develop on when I'm traveling or want to get out ofthe house/office.
Thanks!
Rob
PS. This is for ASP.NET 1.1 development primarily...only occasionally working with ASP.NET 2.0
I've heard of some people using the bigger/more powerful TabletPCs for dev work without any problems. For occasional work that should work very well.
Hth,
TabPage Control ?
Hello,
I want to create a TabPage control for my web application like one page layout with 2 different pages, but in the toolbox VS2005 doesn't have that option, So instead of creating 2 different pages and directing from one to the another, I'm wondering if I could use the TabPage control to keep one page layout and have the ability to flip back and fourth from one page to another, Does anyone knows how to do it and really appreciated if have any tips or suggestions on how to accomplish this, thanks
Have you considered using the ASP.NET AJAX TabControl or using a MultiView control to simulates Tabs?
I would consider to try both if it works, How do you setup the ASP.NET AJAX TabControl in Visual Studio 2005 ? In the toolbox control it doesn't have any TabControl option, all I have is the MultiView in the toolbox but I'm not sure how to setup the multi page inside the MultiView control, Can you guide me through this? thanks
Refer the the link below for an example on using the ASP.NET AJAX TabControl.
http://www.asp.net/learn/ajax-videos/video-156.aspx
Here are a few links for the MultiView Control.
http://www.codeproject.com/aspnet/TabControl.asp
http://www.c-sharpcorner.com/UploadFile/mahesh/Multiview10092005215233PM/Multiview.aspx?ArticleID=ad731f33-820e-4968-89fa-393c43872384
http://www.internet.com/video/ Scroll down the leftside under Developer Videos the Using ASP.NET 2.0 MultiView Control is the last one.
Hope these help.
tabs
r
navigation. How can i create a "tab" look navigation system for my portal?Mike,
Funny you ask...I am working on a similar project. Follow my thread
directly below yours at
http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
"Mike" wrote:
> I'm creating a "portal" type web app and i want to use a "tab" appearance
for
> navigation. How can i create a "tab" look navigation system for my portal
?
>
I too am writing an application with tabs. Wrote mine "by hand" - some HTML
in a user control, and pass a variable to the UC with the current tab. Bit
basic I know but it does the job :o)
"Chris Fink" wrote:
> Mike,
> Funny you ask...I am working on a similar project. Follow my thread
> directly below yours at
> http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
> "Mike" wrote:
>
One way would be to investigate a prebuilt tab control to see if it
offers the functionality you need (and if it includes source, you can
make modifications).
One place to look would be the IE WebControl gallery on asp.net:
http://www.asp.net/ControlGallery/d...y=38&tabindex=2
HTH,
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 15 Oct 2004 07:03:33 -0700, "Chris Fink"
<ChrisFink@.discussions.microsoft.com> wrote:
>Mike,
>Funny you ask...I am working on a similar project. Follow my thread
>directly below yours at
>http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
>"Mike" wrote:
>
Not exactly tabs per se but I accomplished this by using buttons (!).
I put them all right next to each other in a user control, added a
method that changes the active tab and then used CSS to differentiate
(I basically made the button's bottom border go away and made its
background color the same as the page's and bolded the text so it looks
pretty much like a tab, even though it's just a button). The non-active
'tabs' have a totally different background and have all their borders.
It works, even though it may not be perfect.
James
Mike wrote:
> I'm creating a "portal" type web app and i want to use a "tab"
> appearance for navigation. How can i create a "tab" look navigation
> system for my portal?
Hmm.. never gave that one a thought! Guess that's my ASP roots coming throug
h
:)
Another way of doing the tabs might be to use the Tab control that comes
with the IEControls thingy from ASP.NET - don't know if that's the link that
Steve gave - haven't checked.
"James Thomas" wrote:
> Not exactly tabs per se but I accomplished this by using buttons (!).
> I put them all right next to each other in a user control, added a
> method that changes the active tab and then used CSS to differentiate
> (I basically made the button's bottom border go away and made its
> background color the same as the page's and bolded the text so it looks
> pretty much like a tab, even though it's just a button). The non-active
> 'tabs' have a totally different background and have all their borders.
> It works, even though it may not be perfect.
> James
> Mike wrote:
>
>
The only problem with the IE Tab control is that it's not cross-browser
compatible - of course, if that's not what you're striving for, then it
doesn't matter. :)
James
Dan Nash wrote:
> Hmm.. never gave that one a thought! Guess that's my ASP roots coming
> through :)
> Another way of doing the tabs might be to use the Tab control that
> comes with the IEControls thingy from ASP.NET - don't know if that's
> the link that Steve gave - haven't checked.
>
> "James Thomas" wrote:
>
tabs
navigation. How can i create a "tab" look navigation system for my portal?Mike,
Funny you ask...I am working on a similar project. Follow my thread
directly below yours at
http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
"Mike" wrote:
> I'm creating a "portal" type web app and i want to use a "tab" appearance for
> navigation. How can i create a "tab" look navigation system for my portal?
>
I too am writing an application with tabs. Wrote mine "by hand" - some HTML
in a user control, and pass a variable to the UC with the current tab. Bit
basic I know but it does the job :o)
"Chris Fink" wrote:
> Mike,
> Funny you ask...I am working on a similar project. Follow my thread
> directly below yours at
> http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
> "Mike" wrote:
> > I'm creating a "portal" type web app and i want to use a "tab" appearance for
> > navigation. How can i create a "tab" look navigation system for my portal?
One way would be to investigate a prebuilt tab control to see if it
offers the functionality you need (and if it includes source, you can
make modifications).
One place to look would be the IE WebControl gallery on asp.net:
http://www.asp.net/ControlGallery/d...y=38&tabindex=2
HTH,
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 15 Oct 2004 07:03:33 -0700, "Chris Fink"
<ChrisFink@.discussions.microsoft.com> wrote:
>Mike,
>Funny you ask...I am working on a similar project. Follow my thread
>directly below yours at
>http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
>"Mike" wrote:
>> I'm creating a "portal" type web app and i want to use a "tab" appearance for
>> navigation. How can i create a "tab" look navigation system for my portal?
>>
>
Not exactly tabs per se but I accomplished this by using buttons (!).
I put them all right next to each other in a user control, added a
method that changes the active tab and then used CSS to differentiate
(I basically made the button's bottom border go away and made its
background color the same as the page's and bolded the text so it looks
pretty much like a tab, even though it's just a button). The non-active
'tabs' have a totally different background and have all their borders.
It works, even though it may not be perfect.
James
Mike wrote:
> I'm creating a "portal" type web app and i want to use a "tab"
> appearance for navigation. How can i create a "tab" look navigation
> system for my portal?
Hmm.. never gave that one a thought! Guess that's my ASP roots coming through
:)
Another way of doing the tabs might be to use the Tab control that comes
with the IEControls thingy from ASP.NET - don't know if that's the link that
Steve gave - haven't checked.
"James Thomas" wrote:
> Not exactly tabs per se but I accomplished this by using buttons (!).
> I put them all right next to each other in a user control, added a
> method that changes the active tab and then used CSS to differentiate
> (I basically made the button's bottom border go away and made its
> background color the same as the page's and bolded the text so it looks
> pretty much like a tab, even though it's just a button). The non-active
> 'tabs' have a totally different background and have all their borders.
> It works, even though it may not be perfect.
> James
> Mike wrote:
> > I'm creating a "portal" type web app and i want to use a "tab"
> > appearance for navigation. How can i create a "tab" look navigation
> > system for my portal?
>
The only problem with the IE Tab control is that it's not cross-browser
compatible - of course, if that's not what you're striving for, then it
doesn't matter. :)
James
Dan Nash wrote:
> Hmm.. never gave that one a thought! Guess that's my ASP roots coming
> through :)
> Another way of doing the tabs might be to use the Tab control that
> comes with the IEControls thingy from ASP.NET - don't know if that's
> the link that Steve gave - haven't checked.
>
> "James Thomas" wrote:
> > Not exactly tabs per se but I accomplished this by using buttons
> > (!).
> > I put them all right next to each other in a user control, added a
> > method that changes the active tab and then used CSS to
> > differentiate (I basically made the button's bottom border go away
> > and made its background color the same as the page's and bolded the
> > text so it looks pretty much like a tab, even though it's just a
> > button). The non-active 'tabs' have a totally different background
> > and have all their borders.
> > It works, even though it may not be perfect.
> > James
> > Mike wrote:
> > > I'm creating a "portal" type web app and i want to use a "tab"
> > > appearance for navigation. How can i create a "tab" look
> > > navigation system for my portal?
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 in ASP.NET 2.0
Question for all the .NET gurus. I would like to implement tabs in the web application I'm developing. Many that I've talked to and read are pointing me in the direction of AJAX. I would rather wait for another release of AJAX before I start using it, but my question is: Isn't tabs available in ASP.NET 2.0without getting AJAX? For example, when I go to the built in ASP.NET Web Administration Tool it obviously uses tabs and looks like it is built using ASP.NET 2.0 only. I like the look, feel and functionality of the Web Administration tool and want to implement something similiar in my Web Apps. So if this is using it, why can't I without having to get AJAX?
Thanks,
StrickHave a look at the MultiView control.
It kind of depends on what your goal is with the using the tabs.
If it's simply a style of site navigation, it's quite easy to create images and text that duplicate a simple tab look and feel inside a web control. I haven't looked at it closely but I think that's what the ASP.NET configuration web site does in most places. You could then place the control at the top of all of your pages and have it show the right tab for the loaded page. There are plenty of examples around if you Google for them. You can also buy more complex controls that give you more style, functionality, and ease of use options. It really depends on how much you want to code and draw yourself.
If you're wanting a more interactive solution on a single page, you can use the MultiView control to do that. However, you'll still need to code/draw the simulated tabs yourself in much the same way as mentioned above.
AJAX comes into play when you need to have a tabbed display where you want to submit or update parts of a page separate from the rest. For example, you might have an order form where you want to check current inventory levels and warehouse/store locations when a line item is added but you don't want to submit and refresh the whole page to do it.
Thanks guys. I'm going to look into the multiview. Really, I just want it to do the exact same thing that the windows tab control does. Hopefully I won't have to simulate a tab control. If that's the case, I might as well just have separate pages for each hyperlink. I want the multiview to save me the time of having to have separate pages.
Thanks,
Strick
I like the look, feel and functionality of the Web Administration tool and want to implement something similiar in my Web Apps.
The complete source code for the admin tool is in the following folder
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles
Nice, I'll take a look at that. Thanks!
this seems pretty cool:
http://ajax.asp.net/ajaxtoolkit/Tabs/Tabs.aspx
Yeah, I actually downloaded and played with AJAX a little bit last week. It seems really cool. It just seems like it's not integrated into VS 2005 like it should be. I was gonna wait for another version before I start really using it (which is usually my rule of thumb with brand new microsoft products, lol!), but maybe I'll break my rule for AJAX. Maybe I should go get an AJAX book and read it cover to cover...lol. Any recommendations on books?
Yeah, I actually downloaded and played with AJAX a little bit last week. It seems really cool. It just seems like it's not integrated into VS 2005 like it should be. I was gonna wait for another version before I start really using it (which is usually my rule of thumb with brand new microsoft products, lol!), but maybe I'll break my rule for AJAX. Maybe I should go get an AJAX book and read it cover to cover...lol. Any recommendations on books?
if you go to this link:
http://asp.net/learn/videos/default.aspx?tabid=63
and watch the first 2 vids, they will show you how to put the ajax resources and the AjaxConrolToolkit right inside of your toolbox. That makes them pretty much drag n' drop. I couldn't ask for much more integrated. ;)
U know what sucks now? I'm all ready to learn AJAX and the web host I'm with doesn't even support it yet
Well I think in this situation, u better to use MultiView or LoadControl Method either.