|
Having trouble trying to figure out how to center a login control. The docs say that <div align=center> is deprecated. So trying to center it with css style attributes. It will work in ie6, but not in FireFox. Can anyone offer a css centering scheme that will work here???
=====================================================
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="text-align:center">
<form id="form1" runat="server">
<table border="1" cellpadding="0" cellspacing="0" >
<tr>
<td style="width:600px;text-align:center">
<h1>
Website Headline</h1>
<div style="margin auto;width:550px;background-color:Bisque">
<asp:Login ID="login1" runat="server" BorderWidth="1px" Width="300px" TextLayout="TextOnTop" ></asp:Login>
</div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td style="text-align:left">
More Content would go here
</td>
</tr>
</table>
</form>
</body>
</html>
=====================================================
|
|
|
|
|
You can use
....
it works on firefox.
enjoy.
|
|
|
|
|
Yes, I could use <center> (just as I could use <div align=center>, but the docs say that both of those are deprecated. I'm searching for a ccs solution.
Thanks anyway...
|
|
|
|
|
Have you tried a width of 100%?
|
|
|
|
|
|
I read some [semi] constant values from a file at application start
-- File: global.asax.cs --
<br />
protected void Application_Start(Object sender, EventArgs e)<br />
{<br />
Application.Set(Name1, value1);<br />
}<br />
<br />
static public string Name1<br />
{<br />
get { return "NAME1"; }<br />
}<br />
Later, when I need to access the value1, I can do something like:
<br />
literal1.Text = Application[VSDonation.Global.Name1].ToString();<br />
This is all working properly. However, I need to modify the value stored as Application["NAME1"] from an administrative page. I'm having much trouble getting this work. Any pointers or ideas?
Thanks.
--G
|
|
|
|
|
just an idea... can you take in the value and store it in a non-static variable, then store that in another application variable? You are dealing with a static variable after all.
Nila
|
|
|
|
|
My problem is modifying/accessing the Application variable from anything other than the Global class.
|
|
|
|
|
Glenn E. Lanier II wrote: I need to modify the value stored as Application["NAME1"] from an administrative page. I'm having much trouble getting this work.
What kind of trouble?
There should be no problem at all to modify the value. The code is exaclty as when you initally set the value.
---
b { font-weight: normal; }
|
|
|
|
|
If I create a class to write the value (so it can be used once when the application starts up and again when the administrator changes this value), I get:
The type or namespace name 'Application' could not be found (are you missing a using directive or an assembly reference?)
in reference to Application.Set(VSDonation.Global.Name1, sValue);
|
|
|
|
|
Use HttpContext.Current.Application to reference the application object.
---
b { font-weight: normal; }
|
|
|
|
|
<smacks forehead="">D'oh!
My class that was trying to access the Application object was not derived from System.Web.UI.Page. Once I added that to the declaration, I can access the Application space.
Thanks. Sorry.
--G
|
|
|
|
|
That's not really a good way to do it, as your class is not a page.
Use HttpContext.Current.Application to access the application object.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks. I've put that in place and it appears to do the trick in a more correct manner.
--G
|
|
|
|
|
Can anyone give me a good reason to not release Debug code for a web site? I hear it's a security risk but since we control the machine I wouldn't think so. If the machine is hacked we have all sorts of issues. I also hear its a performance issue. Any idea on the performance impact? I would rather have the line numbers for exceptions as it makes debugging exceptions eaiser.
|
|
|
|
|
I know, from experience, that debug code is slow... why do you insist on using that?
This is what I do in my web.config so I can see the exceptions only on the server:
<customErrors mode="RemoteOnly" defaultRedirect="error.htm">
</customErrors>
Nila
|
|
|
|
|
|
|
|
Each site is different. You can automate some operations on your site, and do comparisons with the debug and release builds.
|
|
|
|
|
The Debug code give ideas as the site behaves... making easy the hacker work.
On performance issue, Debug code, the asp.net engine must to check the error, face the error against the asp.net error code table, and write a possible solution.
Release code just write a default error page. the second is fastest solution, but, its irrelevant over small sites.
keep Learning and you never will be out of date...
|
|
|
|
|
Hi,
I am trying to abandon the session which started at Login. When I click on Logout, I am redirected to the Login page, which is fine. The problem is, I can still type in the page address that I want in the address bar OR I can click "Back" on the browser and the pages of the site will load without authentication.
What am I doing wrong? Heres the code I have used:
FRONT END<br />
<br />
<pre><'asp:HyperLink runat="server" cssclass="STlvl2" navigateurl="?Logout=1" id="hlLogout">Logout/></pre><br />
CODE BEHIND<br />
<br />
<pre>If Request.QueryString("Logout") = "1" Then
Session.Abandon()
Response.Redirect("../frmLogin.aspx")
End If</pre><br />
<br />
<br />
-- modified at 10:31 Thursday 16th November, 2006
|
|
|
|
|
It may have been a typo, but why is there a ' in the hyperlink?
Also, why do you have a hyperlink that closes the session. Why not abandon the session in the button click event?
|
|
|
|
|
The ' in the hyperlink is so that the code is displayed on this page lol..
I dont actually have ' in my source code.
Secondly, I think I will try to abandon the session by using the btn.click event as you said through a link button. Maybe that will work.
Thanks for the idea mate.
|
|
|
|
|
Hello,
I am calling page2.aspx from Hyperlink field in Grid in page1.aspx and I pass to Page2.aspx 2 parameters. I would like to hide those parameters from the user.
I mean instead of http://MySite.com/page2.aspx?Param1=0&Param2=1
I would like to get http://MySite.com/page2.aspx and also send those 2 parameters to page2.aspx.
I know how to do it if it was not an hyperlink from a grid:
server.transfer "page2.aspx?Param1=0&Param2=1" and it works fine
Thanx
-- modified at 9:20 Thursday 16th November, 2006
Eric H.
|
|
|
|