|
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...
|
|
|
|
|
The IE rendered is highly sensitive on the actual content inside the <td> ... </td> tags. In your sample, there is nothing, that's why from what I see IE behaves like mad. Usually web designers either fill table with content( ), or stretch a 1-pixel image (you know, that transp gif) to the actual width or height, so to achieve a pixel-perfect rendering.
Btw, using % in several places makes IE think that the overall outside table rendering relies on ratios rather than absolute values. That's probably why it changes with the IE client size.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
Final words, don't expect the same rendering between browsers.
Don't even expect the same rendering between two IE versions.
Don't even even expect the same rendering between a given IE build, and next.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
__Stephane Rodriguez__ wrote:
Final words, don't expect the same rendering between browsers.
Don't even expect the same rendering between two IE versions.
Don't even even expect the same rendering between a given IE build, and next.
Erm, doesn't that defeat the point of a standard, namely HTML? This is basic HTML, not even beyond IE 3/ Netscape 3.
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:
Erm, doesn't that defeat the point of a standard, namely HTML? This is basic HTML, not even beyond IE 3/ Netscape 3.
That's not standard stuff. When it comes to user agent implementation of imbricated table rendering, the W3C has done a pretty great job of not taking into account all possible implementation details. Resulting in the mess we know today.
Besides that, the way you use "px" refers to CSS styles, which adds behaviours depending on the browser. It's better to put a number without suffix : no px, no pt, no em.
About Html, it's all about hints and tries. I am afraid you can spend a whole week on it.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
__Stephane Rodriguez__ wrote:
Besides that, the way you use "px" refers to CSS styles, which adds behaviours depending on the browser. It's better to put a number without suffix : no px, no pt, no em.
That doesnt do anything Same result.
__Stephane Rodriguez__ wrote:
About Html, it's all about hints and tries. I am afraid you can spend a whole week on it.
It's gonna take a shitload longer to "fix" this than the 3 weeks I have spend doing the site I am working.
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.
|
|
|
|
|
Ok, papaoutage off.
<table cellpadding=0 cellspacing=0 width=100%>
<tr><td colspan=3>
<table width=100% border=1>
<tr>
<td width=150><img src="transp.gif" width=150 height=1></td><td></td>
</tr>
</table></td></tr>
<tr><td width=15></td><td colspan=2>
<table width=100% border=1>
<tr>
<td width=100><img src="transp.gif" width=100 height=1></td><td></td>
</tr>
</table></td></tr>
<tr><td width=15></td><td width=15></td><td colspan=1>
<table width=100% border=1>
<tr>
<td width=100><img src="transp.gif" width=100 height=1></td><td></td>
</tr>
</table></td></tr>
<tr><td width=15></td><td colspan=2>
<table width=100% border=1>
<tr>
<td width=100><img src="transp.gif" width=100 height=1></td><td></td>
</tr>
</table></td></tr>
</table>
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|