|
I am building a little non-profit web app, and would like to know the nicest way to offer my 'Enter' page. I would like the message to be database based, together with a link to a terms and conditions page, and an Enter button.
The message warns that entering by clicking the Enter button implies acceptance of the terms and conditions, which are accessible through a hyperlink between the message and the button. I would like the message and the button centred on the page in both planes, and do not want to use tables for this. Which control is best for the text? Label or Literal? And, how do I centre the stuff using CSS?
"Once in Africa I lost the corkscrew and we were forced to live off food and water for weeks." - Ernest Hemingway
My New Blog
|
|
|
|
|
From MSDN:
The Literal control differs from the Label control in that the Literal control does not add any HTML elements to the text. (The Label control renders a span element.) As a consequence, the Literal control does not support any style attributes, including position attributes. However, the Literal control allows you to specify whether content is encoded.
I always use the Label to be able to use styles with it.
If you don't want to use tables, you need to use div .
To center you need to apply a style to the div . Try working with the margin attribute and use % as unit, for example:
.divStyle
{
margin: 20%;
}
This will give a margin of 20% of the available area in all 4 directions.
If you want to use different settings for top/bottom/left/right, you can use this:
margin: 10% 20% 10% 20%;
where the first is the top, the second is bottom, the third is left and the fourth is right.
You need to experiment a little with the values of the percentage to give in each direction by resizing the browser window and checking the behavior of your div .
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Thanks, that'll help me get started, but I have more than one element I want to position. I'll have to play around and see what happens.
"Once in Africa I lost the corkscrew and we were forced to live off food and water for weeks." - Ernest Hemingway
My New Blog
|
|
|
|
|
I usually place the controls (textbox, label, button) needed for the login in one table and then place the table in the div to position it on the page. I believe that positioning all the controls individually is a real mess. You end up having a div per control and then you need to manage the floating of the divs with respect to each other etc... It will eventually work but the time lost is not worth it
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Cool, thanks. I sort of suspected I couldn't easily get away from the tag that shall not be mentioned.
"Once in Africa I lost the corkscrew and we were forced to live off food and water for weeks." - Ernest Hemingway
My New Blog
|
|
|
|
|
Hi Everyone,
Is it possible to disable the specific items in a list box using javascript .Can anyone help me in this regard giving a sample.
Regards,
Manowj
|
|
|
|
|
On JavaScript, actually you can deselect on selection. However, that would be a lousy design. The better approach would be show only what is selectable.
|
|
|
|
|
Hi,
Is it possible to highlight the other items instead of disabling specific items using javascript Onchange event
Regards,
Manowj
|
|
|
|
|
You can try to make use of OPTGROUP trick, to an extent, without confusing the user too much, since OPTGROUP has a different purpose. Isn't it?
|
|
|
|
|
Dear All,
I have a custom ASP:DataGrid and want to check whether to show the image column or not by first checking the existance.
The code is here but face an strange error while rendering:
<%# if (HasImage( DataBinder.Eval(Container.DataItem, "ID").ToString() ) {%>
" width="107" height="111" alt=""> <% } %>
Please Help.
Thanks,
Sassan
|
|
|
|
|
Well what kind of error are you getting?
This code seems wrong. You are fragmenting the if statement into two sections of <% %> and I don't think you can do that.
I might be wrong since I have always used code-behind to write my C# code, so I am not familiar with writing the code in the page itself. You need to get a second opinion on that one.
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Dear Tatal,
I handled it behind the code, But have no time to go on and find the code problem!
I did vote !
Regards,
Sassan
|
|
|
|
|
Thanks. The main thing is that my post helped you somehow.
BTW: it's TALAL, not TATAL
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
hai,
how to get countryname using ipaddress
i just passed some ipaddress through this url and the corresponding country name show in that page only.....
http://api.hostip.info/get_html?ip=ouripaddress
But how can i get that countryname in our aspx page....
any one know reply me with source code...
|
|
|
|
|
We are not getting the cursor position
in Light Boxes in MOZILLA.But in IE not a problem
jophin
|
|
|
|
|
Since you are new, please read the forum guidelines.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
In our project we are facing problems of
wrapping text in panels and all.With
There is no problem with Internet Explorer.
But with MOZILLA text is not Wrapped.
jophin
|
|
|
|
|
Read the forum guidelines.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Perhaps I'm approaching this the wrong way but I'm creating a "community" website to learn the ins and outs of ASP.NET. There's a news page which loads its contents from the database, the Content field of the database stores any valid (x)html as the news item (only limited users have write access to this so I'm keeping the flexibility of allowing all HTML). However it'd be nice if links could use the ~ to symbolise the application root and have these translated automagically. For example the basic (relevant) structure of the site is this:
Home
News (~/news.aspx)
Reports (~/news.aspx?category=Reports)
Shoots (~/news.aspx?category=Shoots)
WCTSA (~/news.aspx?category=WCTSA)
Website (~/news.aspx?category=Website)
Contacts
... However there are some mapped urls going on to create nicely rememberable paths, e.g. the Reports page can be accessed through ~/news/reports.aspx but is mapped to ~/news.aspx?category=Reports . Thus the problem I'm running into is for example to link to the contacts page I could put a link <a href="contacts.aspx">Contacts</a> in the database but if this were viewed from the Reports page it would try ~/news/contacts.aspx rather than ~/contacts.aspx .
So since I'm new to ASP.NET I was wondering if there was some magic way to allow parsing of ~ urls from database fields without having to write a custom parser.
Perhaps as I said I'm going at this the wrong way and it would maybe be easier if I wrote a generic handler which could then be used as the linker, something that redirected the user, e.g. (all my handlers are under the services directory) ~/services/redirect.ashx?url=~/contacts.aspx and get this to resolve the address and redirect. Actually I think that may be the best solution.
|
|
|
|
|
I have one login page where i ahve to check the user given username, password with the database and according to the correct answer i have to redirect him to the corresponding page.
Can anybody help me with coding.................
|
|
|
|
|
Google for Forms Authentication.
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
how to created nested master page a master page that inherits from another master page
md_refay
|
|
|
|
|
Nested means one inside another (when you are talking about a page), inherits means one derives from another (when you're usually talking about classes)
You cannot put a master page inside a master page. You can probably derive a master page class from another master page class. That means that if you have a master page with its corresponding code-behind class, you can create another master page and make it inherit from the first one.
1st Master page:
public partial class Master1: System.Web.UI.MasterPage
{
......
}
2nd Master page inherits from first one:
public partial class Master2 : Master2
{
....
}
I have never done that so I don't know if it works.
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Dear All,
I have descriptions in DB for a news service Like These:
<BR>This is the Short Desc</BR>
I want to render this in a grid using ASP:DataGrid with Custom Template which is a Table. Therefore I have a code like this in my <ItemTemplate> lines:
<span class="style8">
<%# DataBinder.Eval(Container.DataItem, "ShortDesc")%>
</span>
But after rendering not only the text is not bold, but all the contents are also displayed. Therefore If there exists some other HTML Tags, All of them are not interpreted and will be displayed.
Since the Database content is just read only and I can't convert the Data, please let me know how I can show the text as was decorated in the editor.
Thanks,
Sassan
|
|
|
|
|
Use lable control
like <asp:Lable id="lbl" runat="server" text=' <%# DataBinder.Eval(Container.DataItem, "ShortDesc")%>' />
Best Regard
pathan
---------------------------------------------------
|
|
|
|