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 width, height setting is not working.
<asp:Table ID="Table1" runat="server" Width="100%" Height="100%" cellpadding="0" cellspacing="0"> <asp:TableRow ID="TableRow1" runat="server" Width="100%" Height="100%"> <asp:TableCell ID="TableCell1" runat="server" Width="100%" Height="50%">
... </asp:TableCell> <asp:TableCell ID="TableCell1" runat="server" Width="100%" Height="50%">That was wrong code I got above. Here's the right one.... </asp:TableCell> <asp:TableRow><asp:table>
<html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:Table ID="Table1" runat="server" Width="100%" Height="100%" cellpadding="0" cellspacing="0"> <asp:TableRow ID="TableRow1" runat="server" Width="100%" Height="50%" > <asp:TableCell ID="TableCell1" runat="server" Width="100%" Height="100%" BackColor="red" > </asp:TableCell> </asp:TableRow> <asp:TableRow ID="TableRow2" runat="server" Width="100%" Height="50%"> <asp:TableCell ID="TableCell2" runat="server" Width="100%" Height="100%" BackColor="blue"> </asp:TableCell> </asp:TableRow> </asp:Table> </form></body></html>
Another question.
With the code above, even thought I specified the height to 50% to each, it only shows for one row not the whole page.
Please tell me how to divide a page into top half and bottom half so when I set background colors for each half, I can see the division by color.
_____________________________________| || || || Red || || ||_____________________________________|| || || || Blue || || ||_____________________________________|To set like this.
Monday, March 26, 2012
tabs galore
I'm currently working on an asp.net 2.0 project that has many tabs on the
home page. Behind the scenes seems like a nightmare to manage because all the
tabs represented on the home page is a View control inside a MultiView
control (wow, i know). Well I need to add an extra tab to this and i'm afraid
to touch this thing.
does anyone know a good a way to abstract this new tab away from the
confusion cloud?
thanks,
rodchar"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:C34A1FC3-BECD-4613-B4EF-4E8468E89FC1@.microsoft.com...
Quote:
Originally Posted by
does anyone know a good a way to abstract this new tab away from the
confusion cloud?
Is this not all set up in the markup, then...?
Hi Mark,
I'm not sure I understand your reply, please forgive me. Could you please
elaborate a little.
Rodchar
"Mark Rae" wrote:
Quote:
Originally Posted by
"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:C34A1FC3-BECD-4613-B4EF-4E8468E89FC1@.microsoft.com...
>
Quote:
Originally Posted by
does anyone know a good a way to abstract this new tab away from the
confusion cloud?
>
Is this not all set up in the markup, then...?
>
>
>
"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:22125D9D-EE5A-4B36-A76A-DFEE1C5626F1@.microsoft.com...
Quote:
Originally Posted by
I'm not sure I understand your reply, please forgive me. Could you please
elaborate a little.
You mentioned that the tabs were set up using a MultiView control and a lot
of View controls - I was asking if this was done in the markup as opposed to
being dynamically created in code-behind...
Does it not resemble something like this:?
http://www.codeproject.com/aspnet/TabControl.asp
If so, is it not simply a question of adding another <asp:Viewcontrol
wherever you need the new tab to appear...?
yeah that's very true however, what i was wondering is with the basic View
control in place for the new tab could i take the guts of the new tab and
somehow extract it out into another page or user control, or better
suggestions?
"Mark Rae" wrote:
Quote:
Originally Posted by
"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:22125D9D-EE5A-4B36-A76A-DFEE1C5626F1@.microsoft.com...
>
Quote:
Originally Posted by
I'm not sure I understand your reply, please forgive me. Could you please
elaborate a little.
>
You mentioned that the tabs were set up using a MultiView control and a lot
of View controls - I was asking if this was done in the markup as opposed to
being dynamically created in code-behind...
>
Does it not resemble something like this:?
http://www.codeproject.com/aspnet/TabControl.asp
>
If so, is it not simply a question of adding another <asp:Viewcontrol
wherever you need the new tab to appear...?
>
>
>
"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:1F19E9BB-F448-42CE-90CD-695E33A589C6@.microsoft.com...
Quote:
Originally Posted by
yeah that's very true however, what i was wondering is with the basic View
control in place for the new tab could i take the guts of the new tab and
somehow extract it out into another page or user control, or better
suggestions?
Er, well an <asp:Viewis just a container for other controls, so there's
really nothing to stop you doing anything you want with them...
I'm really not seeing what the problem is here...
i guess i just didn't want to have to go and add new code to the existing
code behind page because it is a huge code behind.
"Mark Rae" wrote:
Quote:
Originally Posted by
"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:1F19E9BB-F448-42CE-90CD-695E33A589C6@.microsoft.com...
>
Quote:
Originally Posted by
yeah that's very true however, what i was wondering is with the basic View
control in place for the new tab could i take the guts of the new tab and
somehow extract it out into another page or user control, or better
suggestions?
>
Er, well an <asp:Viewis just a container for other controls, so there's
really nothing to stop you doing anything you want with them...
>
I'm really not seeing what the problem is here...
>
>
>
"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:D3C0B6A4-CAA7-429E-98CC-0AE762D71435@.microsoft.com...
Quote:
Originally Posted by
>i guess i just didn't want to have to go and add new code to the existing
code behind page because it is a huge code behind.
OK - here's what to do...
1) In Project Explorer, highlight the file in question.
2) Type Ctrl-C
3) Type Ctrl-V
You really will be OK... :-)
tabs galore
I'm currently working on an asp.net 2.0 project that has many tabs on the
home page. Behind the scenes seems like a nightmare to manage because all th
e
tabs represented on the home page is a View control inside a MultiView
control (wow, i know). Well I need to add an extra tab to this and i'm afrai
d
to touch this thing.
does anyone know a good a way to abstract this new tab away from the
confusion cloud?
thanks,
rodchar"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:C34A1FC3-BECD-4613-B4EF-4E8468E89FC1@.microsoft.com...
> does anyone know a good a way to abstract this new tab away from the
> confusion cloud?
Is this not all set up in the markup, then...?
Hi Mark,
I'm not sure I understand your reply, please forgive me. Could you please
elaborate a little.
Rodchar
"Mark Rae" wrote:
> "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
> news:C34A1FC3-BECD-4613-B4EF-4E8468E89FC1@.microsoft.com...
>
> Is this not all set up in the markup, then...?
>
>
"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:22125D9D-EE5A-4B36-A76A-DFEE1C5626F1@.microsoft.com...
> I'm not sure I understand your reply, please forgive me. Could you please
> elaborate a little.
You mentioned that the tabs were set up using a MultiView control and a lot
of View controls - I was asking if this was done in the markup as opposed to
being dynamically created in code-behind...
Does it not resemble something like this:?
http://www.codeproject.com/aspnet/TabControl.asp
If so, is it not simply a question of adding another <asp:View> control
wherever you need the new tab to appear...?
yeah that's very true however, what i was wondering is with the basic View
control in place for the new tab could i take the guts of the new tab and
somehow extract it out into another page or user control, or better
suggestions?
"Mark Rae" wrote:
> "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
> news:22125D9D-EE5A-4B36-A76A-DFEE1C5626F1@.microsoft.com...
>
> You mentioned that the tabs were set up using a MultiView control and a lo
t
> of View controls - I was asking if this was done in the markup as opposed
to
> being dynamically created in code-behind...
> Does it not resemble something like this:?
> http://www.codeproject.com/aspnet/TabControl.asp
> If so, is it not simply a question of adding another <asp:View> control
> wherever you need the new tab to appear...?
>
>
"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:1F19E9BB-F448-42CE-90CD-695E33A589C6@.microsoft.com...
> yeah that's very true however, what i was wondering is with the basic View
> control in place for the new tab could i take the guts of the new tab and
> somehow extract it out into another page or user control, or better
> suggestions?
Er, well an <asp:View> is just a container for other controls, so there's
really nothing to stop you doing anything you want with them...
I'm really not seeing what the problem is here...
i guess i just didn't want to have to go and add new code to the existing
code behind page because it is a huge code behind.
"Mark Rae" wrote:
> "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
> news:1F19E9BB-F448-42CE-90CD-695E33A589C6@.microsoft.com...
>
> Er, well an <asp:View> is just a container for other controls, so there's
> really nothing to stop you doing anything you want with them...
> I'm really not seeing what the problem is here...
>
>
"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:D3C0B6A4-CAA7-429E-98CC-0AE762D71435@.microsoft.com...
>i guess i just didn't want to have to go and add new code to the existing
> code behind page because it is a huge code behind.
OK - here's what to do...
1) In Project Explorer, highlight the file in question.
2) Type Ctrl-C
3) Type Ctrl-V
You really will be OK... :-)
tabs not working
You might have better luck getting responses in the Portal Starter Kit forum.
hi,
i've checked the forum you suggested. got the answers. thanks.
Tuesday, March 13, 2012
Target Window question
Im trying to target="top" when the user click on the login button - But its not working for me, any ideas where i put Target="top" sorry im new to .aspx
cheers
ZOIK
Example of code.
<asp:Login ID="Login1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderPadding="4"
BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="Small"
ForeColor="#333333" Height="147px" Width="293px" DestinationPageUrl="~/secure_industry/Default.aspx">
<TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" />
<InstructionTextStyle Font-Italic="True" Font-Size="Small" ForeColor="Black" />
<TextBoxStyle Font-Size="X-Small" />
<LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px"
Font-Names="Verdana" Font-Size="Small" ForeColor="#284775"/>
<LabelStyle Font-Size="Small" />
<CheckBoxStyle Font-Size="Small" />
<HyperLinkStyle Font-Size="Small" />
</asp:Login>
Hi,
I think it is not possible to do that with the inbuilt login control. What you can do is create a login template with the code from the below link and then set the onclick event of the button control to target="_top"
http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/ctrlref/login/LoginTemplate.src
Let me know if you have any issues.
Thanks mate thats excellent.
Targeting a database path that is outside of the current project?
Well, good thing that the forum stated "No question too simple" because I'm sure this is uber basic...
I have a working Default.aspx page that accesses a database (hsDatabase.mdf) within the App_Data folder. Just the basic ASP website structure automatically made by Visual Web Developer 2005 Express Edition.
The page works fine on the local computer.
The problem is, when I put it up on my server on the web, the server requires all databases to be put in a specific "database" folder which is up a level from the html folder where I put my ASP and HTML files. That is, it's outside of the project folder.
And try as I might, I can't seem to get the Default.aspx page to connect with database when it's not residing in a folder called "App_Data" which is at the same level as the ASP file.
I assume that the key lies in how I write the connectionstring in the web.config file?
This is the connectionstring that works on my computer:
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\hsDatabase.mdf;Integrated Security=True;User Instance=True"
But instead of|DataDirectory|\hsDatabase.mdf, I wish I could just put write a hardcoded address like www.mySite.com/database/hsDatabase.mdf.
Or at least a relative path that worked like../../database/hsDatabase.mdf
How can I connect to a database that's outside of my project folder, or anywhere on the web for that matter?
Thanks everyone!
Hopefully this helps -
Imports System.Data.SqlClientImports System.IOImports System.Web.ConfigurationPartialClass DefaultInherits System.Web.UI.PageProtected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.LoadDim bldrAs New SqlConnectionStringBuilder(WebConfigurationManager.ConnectionStrings("connectionStringName").ConnectionString) bldr.AttachDBFilename = Path.GetFullPath("/otherDir/hsDatabase.mdf")' output modified connection string Response.Write(bldr.ConnectionString &"<hr/>")End SubEnd ClassWell, that's a bit more complicated that I thought it would be! Definitely a change from the old ASP style of doing it.
The outputted modified connection string (bldr.ConnectionString),should I be putting that result into my Default.aspx page or my web.config page? And how do I pass that variable from this .aspx.vb page into the correct page?
BTW... the connection code for the Default.aspx page is: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
while the web.config page is: <connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\hsDatabase.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
Thank you so much again!
Hi robchis,
My suggestion could be wrong,so please correct me if you find any mistakes within my suggestion.Based on my understanding and experience,I think of course you can access the database which is outside of your website root directory. I used to access a sql database which is hosted by another server machine from my website and it works fine. The point is, make sure that the data server has sql-server serverside installed with service correctlly configured and started, then within you website, you can click the "configure Data Source" from you sqldatasource control and input the right sql-server server name and choose the right database.After that you will be able to access the database in your site.
For more and detailed information, please refer to:
http://msdn2.microsoft.com/en-us/library/ms178361.aspx
http://dotnetjunkies.com/QuickStartv20/aspnet/doc/data/databases.aspx