|
In an asp file,
First the following in the html head section:
<% if request.querystring("action") = "postupload" and bError = False then %>
<META HTTP-EQUIV="refresh" content="1;URL=<%=sValidatedBaseURL%>/thread-view.asp?threadid=<%=iThreadID%>">
<% end if %>
second in the body section:
<% if not ( request.querystring("action") = "postupload" and bError = False ) then %>
<div align="center"><a href="<%=sValidatedBaseURL%>/thread-view.asp?threadid=<%=iThreadID%>"><img src="<%=sValidatedBaseURL%>/images/back-button.gif" border="0"></a></div>
the whole body part:
<body style="margin ">
<!-- #include file="includes/header.asp"-->
<% if vForumInfo(FI_showquotes) = 1 then%><hr width="90%" size=1><div align="center" class="smalltext"><%=sBBSRandomQuoteText%> <%=GetRandomQuote%></div><% else %><BR><% end if %>
<hr width="90%" size=1>
<div align="center" class="error"><%=sError%></div><BR><BR>
<% if not ( request.querystring("action") = "postupload" and bError = False ) then %>
<div align="center"><a href="<%=sValidatedBaseURL%>/thread-view.asp?threadid=<%=iThreadID%>"><img src="<%=sValidatedBaseURL%>/images/back-button.gif" border="0"></a></div><BR>
<form ENCTYPE="multipart/form-data" method="post" action="attach-file.asp?threadid=<%=iThreadID%>&action=postupload">
<table align="center" width="50%">
<tr><td colspan="2" class="messagecellheader">Attach a file</td></tr>
<tr><td colspan="2" class="messagecellbody2">Thread: "<%=ValidateField(sThreadSubject)%>"</td></tr>
<tr><td class="messagecellbody">File:</td>
<td class="messagecellbody"><input type="file" name="attachment" size="40"></td></tr>
<tr><td class="messagecellbody2">Instructions:</td>
<td class="messagecellbody2">Attachments must be less than <%=vForumInfo(FI_MaxAttachSize)%>KB<BR><BR>If this thread already has an attachment,<BR>uploading a new attachment will overwrite the old one.<BR><BR>If you leave the file blank, the attachment will be deleted.</td></tr>
<tr><td class="messagecellbody"> </td>
<td class="messagecellbody"><input type="image" src="<%=sValidatedBaseURL%>/images/submit-button.gif"></td></tr>
</table>
</form>
<% end if %>
<!-- #include file="includes/footer.asp"-->
</body>
please I want help,maybe the questions are very simple,so take some trouble to answer me.
<small><b>this is my signature for forums quoted from shog*9:</b>
<b><u>I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.</u></b></small>
|
|
|
|
|
I want to set up my home page in such a way that, it should go to the localhost or to the website, depending on the net connection availability.
Any idea?? I use dial up serviece.....
Tahnks in advance,
SPS
|
|
|
|
|
howdy all,
busy designing a new web application that would be perfectly suited to a webclass application.
ie. one template page that defines the layout and within that layout tokens to define where runtime generated content should be placed.
my question is this ...
how should we be doing this kind of thing in asp.net ?
should we build server controls and drop these onto the aspx pages ?
should we build one page that serves as a template and the other pages inherit from this ?
should we still use something similar to token substitution ?
please help, any ideas ... suggestions ... guidance would be hugely appreciated
cheers
Ryan
|
|
|
|
|
Page Templates in ASP.NET[^]
ASP.NET is far more powerful in this manner than vb6 webclasses
You can also use user/custom/server controls for this, but in reality you will find yourself using both technologies.
|
|
|
|
|
thanks ... i have been toying with some ideas, of which some are good - others seem better.
has anybody had experience in implementing this type of thing ? which method is best ?
i am currently toying with the idea of using a base class that all pages inherit from. this base class will use user controls to dynamically build their content at runtime. each page will then only be concerned with what needs to be placed in the content section, the base class will handle the rest.
is there an equivalent to visual inheritance in asp.net ?
cheers
Ryan
|
|
|
|
|
ryancrawcour wrote:
which method is best
Both... lol.
When you need a consistent "style" for a bunch of pages sitewide then use a template. But then in your template also make use of custom controls.
They are not mutually exclusive.
ryancrawcour wrote:
is there an equivalent to visual inheritance in asp.net ?
Not sure officially what visual inheritance is but Google has some links.
|
|
|
|
|
Is it possible to put user control in datalist to bind one of its propeties to database?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Hi, everyone!
When I use the following statments in JSP to
connect to DB2, I meet with a trouble,
--------
Connection con = DriverManager.getConnection(url, user, password);
--------
The error is:
--------
java.sql.SQLException: No suitable driver
at
java.sql.DriverManager.getConnection(DriverManager.java:543)
at
java.sql.DriverManager.getConnection(DriverManager.java:183)
... ...
--------
Here url is a String whose value is jdbc:db2://localhost/MYTEST
But when I change the value to
jdbc:db2:MYTEST, then everything is OK!
I do not know why.
I want to know the format of the url of a DB2 database when
I want to connect to a DB2 database on a remote machine.
Cheers,
George
|
|
|
|
|
Alright this has driven me mad and I am sick of reading other answers which get 99% of the way there and then fall over at the last step for me. I am sure I am missing something fundamental, but simple, here.
Basically I have a custom/server/whatever control which dynamically adds controls to itself in an overriden Render method. It adds three controls; two image buttons and a panel. They all render fine and look lovely, but what I want is for an event to be fired when I click either of the image buttons. When clicked the image buttons will set a member var. of the control.
Here is the code so far with what the event handling which I thought would work:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace bluegrass.content
{
public class resourcegallery : WebControl
{
public string View;
<code>private void view_thumbnail_Click(object sender, ImageClickEventArgs e)
{
this.View = "Thumbnail";
}</code>
<code>private void view_list_Click(object sender, ImageClickEventArgs e)
{
this.View = "List";
}</code>
protected override void Render(HtmlTextWriter output)
{
<code>ImageButton imgViewThumbnail = new ImageButton();</code>
imgViewThumbnail.ID = "view_thumbnail";
imgViewThumbnail.ImageUrl = "res/img/view_thumbnail.gif";
imgViewThumbnail.AlternateText = "Click for a Thumbnail view of the Resource Gallery";
imgViewThumbnail.CssClass = "viewbutton";
if (View == "Thumbnail") imgViewThumbnail.Visible = false;
<code>imgViewThumbnail.Click += new System.Web.UI.ImageClickEventHandler(this.view_thumbnail_Click);</code>
<code>this.Controls.Add(imgViewThumbnail);</code>
<code>ImageButton imgViewList = new ImageButton();</code>
imgViewList.ID = "view_list";
imgViewList.ImageUrl = "res/img/view_list.gif";
imgViewList.AlternateText = "Click for a List view of the Resource Gallery";
imgViewList.CssClass = "viewbutton";
if (View == "List") imgViewList.Visible = false;
<code>imgViewList.Click += new System.Web.UI.ImageClickEventHandler(this.view_list_Click);</code>
this.Controls.Add(imgViewList);
Panel panelResourceGallery = new Panel();
panelResourceGallery.ID="ResourceGallery";
panelResourceGallery.CssClass="resourcegalleryview";
panelResourceGallery.Controls.Add(new LiteralControl(View));
this.Controls.Add(panelResourceGallery);
base.Render(output);
}
}
}
The event handling and relevant imagebuttons are highlighted.
So in short when either imgViewList or imgViewThumbnail are clicked client side I want the view_list_Click and view_thumbnail_Click handlers to be fired.
Please remember this is a custome control, not a user control (I can raise events fine in a user control, but I need the capabilities of a custom control.)
Thanks for any help
|
|
|
|
|
I assume it's not working because the scope of imgViewThumbnail, imgViewList and panelResourceGallery are all lost when you leave Render(). Thus all the EventHandlers will be destroyed when you leave the function.
Have you tried making panelResourceGallery a property of resourceGallery?
[edit]Terminology failure error: by function I mean method and by property I mean member variable [/edit]
Paul
Life is just a sexually transmitted desease - Matthew Wright (ex-journalist, TV presenter) 10-Oct-02
I finally have a sig! - Paul Riley (part-time deity) 10-Oct-02
|
|
|
|
|
Paul Riley wrote:
I assume it's not working because the scope of...
Oh man the light just went on and owners arrived home (home being my brain.)
You are two inches from the answer. The answer is to do with the control life cycle rather than scope, but your scope idea twigged me to the life cycle bit. i.e. I need to be assigning the event handlers and everything else in the OnInnit method/event/function/whatever-the-right-label-is-but-who-really-cares-huh and not the Render. Render is done almost last, already past the event firing stage.
*sigh* One of those "lets be dumb" days
Thanks Paul.
|
|
|
|
|
You know what's really sickening? I just came to the same conclusion but you got in before I could post an extra reply.
Ho hum... doesn't matter as long as you got it working
Paul
Life is just a sexually transmitted desease - Matthew Wright (ex-journalist, TV presenter) 10-Oct-02
I finally have a sig! - Paul Riley (part-time deity) 10-Oct-02
|
|
|
|
|
Paul Riley wrote:
Ho hum... doesn't matter as long as you got it working
But it does, it is the thought that counts here, so thank you
I am just really glad my problem was something simple and not that I had to implement more delegates and interfaces and what not. Go .NET!
|
|
|
|
|
I'd like to test my ASP.NET app with SSL to make sure all the links work etc before I publish it on the main site.
Can I get or generate a test SSL certificate for this purpose?
When I go to my main site I can use a shared SSL certificate (cheaper) are there any known problems with using Shared SSL and an ASP.NET app (codebehind). Or should I use a full blown one (more costly).
TIA
Shaun
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
you can go to www.verisign.com[^] and register a "test" certificate. After a month they will email you and ask you to buy a proper one. Ignore them and carry on. We purchased one for our live server from them, but then needed to test the stuff on our dev server, so we did this. Our month has passed, but the test cert is still working nicely
Dave Goodman on funny error messages:
It is a definite no-no to run BITMAP as a user command. Your nose will grow, your lawn will die, your hair will fall out, and your first-born will marry an aardvark. Shame on you!
|
|
|
|
|
thanks megan
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
Pleasure
Dave Goodman on funny error messages:
It is a definite no-no to run BITMAP as a user command. Your nose will grow, your lawn will die, your hair will fall out, and your first-born will marry an aardvark. Shame on you!
|
|
|
|
|
And go there fast. They slashed 50% of their workforce lately. (F'Cpy for more details).
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
you can also install a "MS Certificate Server",and get a server certificate from it!
it's distributed with Win2000 and you can find it in your Win2000 CDROM!
|
|
|
|
|
hmmm.. I always seem to find the hard route. Thanks (for next time)
Help! I'm an AI running around in someone's f*cked up universe simulator. - Marc Clifton
|
|
|
|
|
When IE connect to a website using SSL,IE will display a dialog to ask user to select a certificate of him(or her).
In fact,IE connect to the system's CSP and search user's certificate.
my question is:
if my certificate is stored in other place,but not in the system's CSP or a SmartCard,how can I have IE use my certificate when it connect to a SSL website?
For example,I store my certificate(and private key) in my own USB card,which is not compatible with the SmartCard.What can I do?
I think that if I can hold up the event which occur when IE connect to the system CSP for requiring a user certificate(and private key),it will be simple!
thanks advance!
|
|
|
|
|
Hi all. I am very sad
OK, I have the following HTML. A table with 4 rows, each row have variable cols and contains a table in the last column. Now my understanding is the the "inner" table should not affect how the outer table is "rendered". So what we have here is:
<table cellpadding=0 cellspacing=0 width=100%>
<tr><td colspan=3>
<table width=100% border=1>
<tr>
<td width=100px></td><td></td>
</tr>
</table>
</td></tr>
<tr><td width=15px></td><td colspan=2>
<table width=100% border=1>
<tr>
<td width=100px></td><td></td>
</tr>
</table>
</td></tr>
<tr><td width=15px></td><td width=15px></td><td colspan=1>
<table width=100% border=1>
<tr>
<td width=100px></td><td></td>
</tr>
</table>
</td></tr>
<tr><td width=15px></td><td colspan=2>
<table width=100% border=1>
<tr>
<td width=100px></td><td></td>
</tr>
</table>
</td></tr>
</table>
Now if you will kind enough to paste that in a blank page, you will see all looks well, especially when resizing the browser sideways. IOW the left hand "padding" TD's stays fixed. All happy, all OK. Btw, I use IE6 XP SP1.
Now change the the width attribute of the first inner table's TD from 100px to 150px. This shouldn't have an effect on the the outer table, yet when you now resize the browser sideways, the padding becomes relative. Now HTF is this possible? If you are still interested at this stage, try playing around with the other widths, you will see even stranger things happening, eg some rows are fixed and some are "variable".
Is it me or is this just the way it is? It makes tables very inflexable indeed. [edit] The same page with different widths for the TD's renders correctly in Mozilla 1.1 and Netscape 6.2.3, not in IE 5 however. IE 0 - NS 1. [/edit]
All help appreciated. Cheers.
PS: Message intentionally posted in text.
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
Haven't tested the code, but btw never put </td> tags in begin of lines. There is a known IE rendering bug about it. Put </td> in tail instead.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
__Stephane Rodriguez__ wrote:
never put tags in begin of lines. There is a known IE rendering bug about it.
Didn't know that ( pretty gay IMHO ). Thanx
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
leppie wrote:
never put tags in begin of lines. There is a known IE rendering bug about it.
I haven't had any problem with it yet... must be in older versions.
Word of the day: Rotundacrat
Extra Credit will be awarded for: Quasimobo...
|
|
|
|