Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Thursday, March 29, 2012

Newbie -- pls help

Hi all,

Reali need some help here.

I'm using <repeaterto display few thing taken from the dB.
1. hidden field, which contains the Language code (stored in dB)
2. Textbox

Code goes:

<asp:repeater id="myRepeater" runat="server">
<itemtemplate>
<asp:panel id="pnlCountry" runat="server">
<asp:table>
<tr>
<td>
<asp:label id="lblCounty" runat="server" text="T&Cs: "></asp:label><br>
<%# Container.DataItem("LanguageCode") %>
</td>
<td>
<asp:textbox id="txtTnC" runat="server" textmode="multiline" rows="10"
columns="45"></asp:textbox>
</td>
</tr>
<tr><td>
<INPUT id="hdnLanguage" type="hidden" runat="server" NAME="hdnAltLanguage"
value=<%# Container.DataItem("LanguageCode") %>>
</td>
</tr>
</asp:table>
</asp:panel>
</itemtemplate>
</asp:repeater>

OnClick of a button, i want to get the values entered in the textfields for
the different languages.

How do i do that? What events to use??

Pls help me!!!

Thanx lotz..

RegarDx..Well if you want to do something when someone click a button then put it in
the OnClick event handler. If you want to access the values in the labels
and textboxes in the repaeater control then you would use the command

myRepeater.FindControl("ControlID")

This will return a reference to the relevent control, although all controls
within the parent container (i.e. myRepeater) must have unique IDs.

your code for the asp:table markup is wrong. You have created an asp:table
but left out an ID and a runat=server which are required. You have also used
HTML row and column markup, to create rows and columns in an asp:table you
use <asp:TableRowand <asp:TableCell not <trand <td>.

"siLver" wrote:

Quote:

Originally Posted by

Hi all,
>
Reali need some help here.
>
I'm using <repeaterto display few thing taken from the dB.
1. hidden field, which contains the Language code (stored in dB)
2. Textbox
>
Code goes:
>
<asp:repeater id="myRepeater" runat="server">
<itemtemplate>
<asp:panel id="pnlCountry" runat="server">
<asp:table>
<tr>
<td>
<asp:label id="lblCounty" runat="server" text="T&Cs: "></asp:label><br>
<%# Container.DataItem("LanguageCode") %>
</td>
<td>
<asp:textbox id="txtTnC" runat="server" textmode="multiline" rows="10"
columns="45"></asp:textbox>
</td>
</tr>
<tr><td>
<INPUT id="hdnLanguage" type="hidden" runat="server" NAME="hdnAltLanguage"
value=<%# Container.DataItem("LanguageCode") %>>
</td>
</tr>
</asp:table>
</asp:panel>
</itemtemplate>
</asp:repeater>
>
>
OnClick of a button, i want to get the values entered in the textfields for
the different languages.
>
How do i do that? What events to use??
>
Pls help me!!!
>
Thanx lotz..
>
RegarDx..
>
>

Thursday, March 22, 2012

Newbie image question.

How do i display an image stored in a database in an
asp.net web form?

I assume the image need not to be scaled.On Sat, 12 Jun 2004 03:38:37 +0200, Jensen bredal
<jensen.bredal@.mimosa.com> wrote:

> How do i display an image stored in a database in an
> asp.net web form?
> I assume the image need not to be scaled.

For some reason, I couldn't find a simpler example than this:

http://www.codeproject.com/aspnet/image_asp.asp

Check out the latter part of the article, view.aspx is what you're looking
for. The only thing is the author created a custom class for DB
interaction, don't let it confuse you in the code. The DB access code is
above the section I'm referring to.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
On Sat, 12 Jun 2004 20:58:36 -0500, Craig Deelsnyder
<cdeelsny@.no_spam_4_meyahoo.com> wrote:

> On Sat, 12 Jun 2004 03:38:37 +0200, Jensen bredal
> <jensen.bredal@.mimosa.com> wrote:
>> How do i display an image stored in a database in an
>> asp.net web form?
>>
>> I assume the image need not to be scaled.
>>
>>
> For some reason, I couldn't find a simpler example than this:
> http://www.codeproject.com/aspnet/image_asp.asp
> Check out the latter part of the article, view.aspx is what you're
> looking for. The only thing is the author created a custom class for DB
> interaction, don't let it confuse you in the code. The DB access code
> is above the section I'm referring to.

dang, sorry for the extra reply...my newsreader broke the thread and i
didn't notice...

enjoy...

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Well that example was great too. But i have noticed two things compare with
previous link i got.

The example here does not tell you how to display the image from a datagrid
as an example.

And other thing that is common to both example is that the
response.ContenType is not set from a value in database.
Im my code i also do store Response.ContentType and
that should lead to the following:

Response.ContentType = dr[ImageContentType].ToString();
where dr is the datarow containing my image info.

Many thanks

"Craig Deelsnyder" <cdeelsny@.no_spam_4_meyahoo.com> wrote in message
news:opr9if21dg75dg5d@.tux...
> On Sat, 12 Jun 2004 20:58:36 -0500, Craig Deelsnyder
> <cdeelsny@.no_spam_4_meyahoo.com> wrote:
> > On Sat, 12 Jun 2004 03:38:37 +0200, Jensen bredal
> > <jensen.bredal@.mimosa.com> wrote:
> >> How do i display an image stored in a database in an
> >> asp.net web form?
> >>
> >> I assume the image need not to be scaled.
> >>
> >>
> > For some reason, I couldn't find a simpler example than this:
> > http://www.codeproject.com/aspnet/image_asp.asp
> > Check out the latter part of the article, view.aspx is what you're
> > looking for. The only thing is the author created a custom class for DB
> > interaction, don't let it confuse you in the code. The DB access code
> > is above the section I'm referring to.
> dang, sorry for the extra reply...my newsreader broke the thread and i
> didn't notice...
> enjoy...
> --
> Craig Deelsnyder
> Microsoft MVP - ASP/ASP.NET

Newbie image question.

How do i display an image stored in a database in an
asp.net web form?
I assume the image need not to be scaled.Jensen,
Here's an article that Dino Esperante wrote on the subject: -
http://www.ftponline.com/vsm/2002_0...ttips/esposito/
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com
Dino Esposito rather! :-) Sorry Dino!
Phil.
Phil Winstanley [Microsoft MVP ASP.NET] wrote:
> Jensen,
> Here's an article that Dino Esperante wrote on the subject: -
> http://www.ftponline.com/vsm/2002_0...ttips/esposito/
> Hth,
> Phil Winstanley
> Microsoft ASP.NET MVP
> http://www.myservicescentral.com
Thank you...
"Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote i
n
message news:caepln$c1s@.odbk17.prod.google.com...
> Dino Esposito rather! :-) Sorry Dino!
> Phil.
> Phil Winstanley [Microsoft MVP ASP.NET] wrote:
>
On Sat, 12 Jun 2004 03:38:37 +0200, Jensen bredal
<jensen.bredal@.mimosa.com> wrote:

> How do i display an image stored in a database in an
> asp.net web form?
> I assume the image need not to be scaled.
>
For some reason, I couldn't find a simpler example than this:
http://www.codeproject.com/aspnet/image_asp.asp
Check out the latter part of the article, view.aspx is what you're looking
for. The only thing is the author created a custom class for DB
interaction, don't let it confuse you in the code. The DB access code is
above the section I'm referring to.
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
On Sat, 12 Jun 2004 20:58:36 -0500, Craig Deelsnyder
<cdeelsny@.no_spam_4_meyahoo.com> wrote:

> On Sat, 12 Jun 2004 03:38:37 +0200, Jensen bredal
> <jensen.bredal@.mimosa.com> wrote:
>
> For some reason, I couldn't find a simpler example than this:
> http://www.codeproject.com/aspnet/image_asp.asp
> Check out the latter part of the article, view.aspx is what you're
> looking for. The only thing is the author created a custom class for DB
> interaction, don't let it confuse you in the code. The DB access code
> is above the section I'm referring to.
>
dang, sorry for the extra reply...my newsreader broke the thread and i
didn't notice...
enjoy...
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Well that example was great too. But i have noticed two things compare with
previous link i got.
The example here does not tell you how to display the image from a datagrid
as an example.
And other thing that is common to both example is that the
response.ContenType is not set from a value in database.
Im my code i also do store Response.ContentType and
that should lead to the following:
Response.ContentType = dr[ImageContentType].ToString();
where dr is the datarow containing my image info.
Many thanks
"Craig Deelsnyder" <cdeelsny@.no_spam_4_meyahoo.com> wrote in message
news:opr9if21dg75dg5d@.tux...
> On Sat, 12 Jun 2004 20:58:36 -0500, Craig Deelsnyder
> <cdeelsny@.no_spam_4_meyahoo.com> wrote:
>
> dang, sorry for the extra reply...my newsreader broke the thread and i
> didn't notice...
> enjoy...
> --
> Craig Deelsnyder
> Microsoft MVP - ASP/ASP.NET