|
Hmmm, I've never experienced that.But I always use a simple HtmlTable for layout. If push comes to shove, you can try that instead.
Senkwe
Just another wannabe code junky
|
|
|
|
|
Thanks, Senkwe. Actually, I figured it out last night. Turns out that I'd somehow set my WebForm to target Internet Explorer 3.0 or below, and since those browsers don't support controls being layed on top of one another, it wraps them in table tags. None of my controls were overlapping, so I guess the designer was just playing it safe.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
I want to display a value as hours which is stored as seconds in a database so I need to convert the value when I bind it to a textbox control. Something like this:
<asp:textbox id="hours" size="3" text='<%# DataBinder.Eval(Container.DataItem, "interval") / 3600 %>' runat="server" />
On the submit side it's easy enough to convert it back to seconds but I'm not sure how to convert it on the aspx side. I can probably change the sql statement but I would like to avoid that. I would also like to avoid having to do the conversion in the page_load function. Can this be done?
Todd Smith
|
|
|
|
|
The method I've used for this type of problem is to create a public method that formats the required output
<asp:textbox id="hours" size="3" text='<%# MyFunction(DataBinder.Eval(Container.DataItem, "interval", "{0}") )%>' runat="server" />
public string MyFunction(string strSeconds)
{
return int.Parse(strSeconds) / 3600;
}
|
|
|
|
|
That works. thx.
<asp:textbox id="hours" size="3" text='<%# Utils.SecsToHours(DataBinder.Eval(Container.DataItem, "hours").ToString()) %>' runat="server" />
public static string SecsToHours(string seconds)
{
try
{
int secs = Int32.Parse(seconds);
int hours = secs / 3600;
return hours.ToString();
}
catch
{
return "";
}
}
Todd Smith
|
|
|
|
|
HI,
IIS is being a twat. It won't let users download .exes from my web site. They user gets a 404 when the input the URL when I know for a fact that the files are there. Could it be some sort of security 'feature' that is causing this? I have run the IIS lockdown tool in the past - is it possible that this has affected it?
By the way, HTML, ASP, JPG, GIF all work fine.
Cheers
|
|
|
|
|
For anyone that cares, I think this is due to IIS lockdown as it restricts the downloading fo some filetypes. I'l know better when I get home tonight and try it out.
|
|
|
|
|
Try setting the Application Settings (Home Directory) the Execute Permissions on None (or Scripts only).
Next check HTTP Headers, File Types for the Registered file type .exe (this must be application/octet-stream).
Succes!
|
|
|
|
|
Thanks for the response but it was the URLScan component of IIS Lockdown wheich was restricting the downloading of exes. God know why
|
|
|
|
|
URLScan blocks exes because they might run on the server, depending on the configuration. You can comment out the exe extension in the DenyExtensions section of the urlscan.ini file [%systemroot%\system32\inetsrv\urlscan\urlscan.ini ], or create an asp page to handle the request and Response.BinaryWrite the file.
|
|
|
|
|
Hi All
I have a data populated in HTML table (3 columns, mutiplerows), I have a text box in the col1,row1. when I press Tab button the focus goes to col2,row1 then col3,row1...what I need is how to make the tabing goes from col1,row1 to col1,row2???????
Thanks in advance
|
|
|
|
|
If you set the tabindex property of the text boxes you can control the tab flow.
|
|
|
|
|
Is there a way to import Excel-files with ASP and can you put the data into a database (like MsSQL)
Thanks!!!
Morten
|
|
|
|
|
Yes, you can use ADO to read from the Excel file, or just the Excel COM objects if it is installed.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Hi,
Here's what I'm trying to do:
I have a local application which stores data (locally) in an access or SQLServer database. What I need to do is pass a subset of that data to a remote database on the internet. There are a couple of provisos though - can only use c++/WIN32 on the client (no MFC or .Net), can use any damn technology on the server.
Here are a few methods I have considered:-
1) Convert to XML locally, upload to server using FTP, parse using XML control from ASP page and write into DB. (bit cludgy)
2) Convert to XML string , write to ASP page as HTTP POST and parse in ASP page.
3) Use some crazy new .NET technology (on the server only) to accomplish this for me?
The amount of data transmitted is likely to be pretty small (~10K).
Anybody have any thoughts/suggestions??
Cheers
|
|
|
|
|
Use SQLXML on the server.
|
|
|
|
|
Does this allow you to insert into the remote DB. I've had a quick look on MSDN and it looks like it can be used to query remote data sources but I need to insert. I also need the client to work without any special software (like SOAP or .NET).
Can you point me at any links or other info?
Cheers
|
|
|
|
|
Not sure if this will help you but it could be a start
|
|
|
|
|
James Spibey wrote:
I have a local application which stores data (locally) in an access or SQLServer database.
Which one? If you have SQL Server as your source you could create a DTS package to grab information and push it out to another source.
Nick Parker
|
|
|
|
|
How do you create page templates? Do you use the old fashioned #include to bring in headers and footers, or create user controls that contain aggregated user controls and HTML for your headers and footers, or do you rely on CodeBehind and inject headers/footers before/after the Rendering?
cheers,
Chris Maunder
VC++ - the language that doesn't say 'no'
|
|
|
|
|
I've used the user control method.
|
|
|
|
|
That's a really good question. I have just started building my own site and have designed a quite pretty default.aspx with three web controls (header, footer, and navigator), all arranged with tables. Now I am confronted with the same problem. How to keep all pages consistent? I thought of using plain vanilla #include s, but still didn't come to a decision
Regards
Thomas
Sonork id: 100.10453 Thömmi
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
I've decided to use the old fashioned #include method to keep things neat and simple
cheers,
Chris Maunder
|
|
|
|
|
Is there anyone who know how to inport excel files into an database with ASP.NET.
Thanks!!
Morten
|
|
|
|
|
You would use ADO.Net with a special driver for connecting to an Excel spreadsheet and then make another connection to a real database and shove the stuff in there.
David Stone
dstone@newcenturytitle.com
MEEKNESS, n. Uncommon patience in planning a revenge that is worth while.
The Devil's Dictionary, Ambrose Bierce
|
|
|
|