Saturday, March 31, 2012
Set a icon to a web application
I would like to set an different icon, than explorer icon, to my web
application. When we visit a web page, usually in address bar appears IE
icon before the address. What I want is to substitute that icon to another,
like happens when we visit, for example, http://www.codeproject.com .
How can I do that?
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
rucai dont see any difference for www.codeproject.com
Av.
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
> another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
>
Hi Ruca,
Do you mean the favorite.ico have a look for that on Google.
Cor
Try something like
<link rel="icon" href="http://links.10026.com/?link=/favicon.ico" type="image/ico">
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
>
ruca wrote:
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears
> IE icon before the address. What I want is to substitute that icon to
> another, like happens when we visit, for example,
> http://www.codeproject.com .
> How can I do that?
This has nothing to do with ASP.NET, it's just a feature in Internet
Explorer.
You only have to provide an icon with a specific format and name
in the root of your website.
For more information, do a Google search for "favicon".
Jos
Hi
http://www.favicon.com/
Best Regards
Vidar Petursson
==============================
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/
http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground: http://213.190.104.211/ ( IE 5.5+ only )
No matter where you go there you are
==============================
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
> another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
>
Yes, that's it.
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Cor Ligthert" <notfirstname@.planet.nl> escreveu na mensagem
news:eZp2EnvREHA.1388@.TK2MSFTNGP09.phx.gbl...
> Hi Ruca,
> Do you mean the favorite.ico have a look for that on Google.
> Cor
>
I think that this don't work very well with IE 6.0
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Cor Ligthert" <notfirstname@.planet.nl> escreveu na mensagem
news:eZp2EnvREHA.1388@.TK2MSFTNGP09.phx.gbl...
> Hi Ruca,
> Do you mean the favorite.ico have a look for that on Google.
> Cor
>
Hi Ruca,
You are right, when you delete the cache from IE 6.0 it is gone. However
that is in my opinion an IE bug. It is with all favicons. I thought that in
Mozilla and Netscape it stays.
I made a mistake it has to be favicon instead of favorite as others wrote,
sorry for that.
Cor
"Cor Ligthert" <notfirstname@.planet.nl> wrote in message news:upVR1h8REHA.3840@.TK2MSFTNGP09
.phx.gbl...
> Hi Ruca,
> You are right, when you delete the cache from IE 6.0 it is gone. However
> that is in my opinion an IE bug. It is with all favicons. I thought that i
n
> Mozilla and Netscape it stays.
> I made a mistake it has to be favicon instead of favorite as others wrote,
> sorry for that.
> Cor
>
A tip: look for the utility FavOrg, it downloads all favicons for your
favorites and preserves them outside of the browsercache.
Hans Kesting
Set a icon to a web application
I would like to set an different icon, than explorer icon, to my web
application. When we visit a web page, usually in address bar appears IE
icon before the address. What I want is to substitute that icon to another,
like happens when we visit, for example, http://www.codeproject.com .
How can I do that?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
rucai dont see any difference for www.codeproject.com
Av.
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
> another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
Hi Ruca,
Do you mean the favorite.ico have a look for that on Google.
Cor
Try something like
<link rel="icon" href="http://links.10026.com/?link=/favicon.ico" type="image/ico"
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
ruca wrote:
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears
> IE icon before the address. What I want is to substitute that icon to
> another, like happens when we visit, for example,
> http://www.codeproject.com .
> How can I do that?
This has nothing to do with ASP.NET, it's just a feature in Internet
Explorer.
You only have to provide an icon with a specific format and name
in the root of your website.
For more information, do a Google search for "favicon".
--
Jos
Hi
http://www.favicon.com/
--
Best Regards
Vidar Petursson
==============================
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/
http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground: http://213.190.104.211/ ( IE 5.5+ only )
No matter where you go there you are
==============================
"ruca" <ruuca@.iol.pt> wrote in message
news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I would like to set an different icon, than explorer icon, to my web
> application. When we visit a web page, usually in address bar appears IE
> icon before the address. What I want is to substitute that icon to
> another,
> like happens when we visit, for example, http://www.codeproject.com .
> How can I do that?
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
Yes, that's it.
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Cor Ligthert" <notfirstname@.planet.nl> escreveu na mensagem
news:eZp2EnvREHA.1388@.TK2MSFTNGP09.phx.gbl...
> Hi Ruca,
> Do you mean the favorite.ico have a look for that on Google.
> Cor
I think that this don't work very well with IE 6.0
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Cor Ligthert" <notfirstname@.planet.nl> escreveu na mensagem
news:eZp2EnvREHA.1388@.TK2MSFTNGP09.phx.gbl...
> Hi Ruca,
> Do you mean the favorite.ico have a look for that on Google.
> Cor
Hi Ruca,
You are right, when you delete the cache from IE 6.0 it is gone. However
that is in my opinion an IE bug. It is with all favicons. I thought that in
Mozilla and Netscape it stays.
I made a mistake it has to be favicon instead of favorite as others wrote,
sorry for that.
Cor
"Cor Ligthert" <notfirstname@.planet.nl> wrote in message news:upVR1h8REHA.3840@.TK2MSFTNGP09.phx.gbl...
> Hi Ruca,
> You are right, when you delete the cache from IE 6.0 it is gone. However
> that is in my opinion an IE bug. It is with all favicons. I thought that in
> Mozilla and Netscape it stays.
> I made a mistake it has to be favicon instead of favorite as others wrote,
> sorry for that.
> Cor
A tip: look for the utility FavOrg, it downloads all favicons for your
favorites and preserves them outside of the browsercache.
Hans Kesting
In article <uv0VIfvREHA.3348@.TK2MSFTNGP09.phx.gbl>, avn@.newsgroups.com
says...
> i dont see any difference for www.codeproject.com
> Av.
> "ruca" <ruuca@.iol.pt> wrote in message
> news:%23pGQAYvREHA.3420@.TK2MSFTNGP11.phx.gbl...
> > Hi,
> > I would like to set an different icon, than explorer icon, to my web
> > application. When we visit a web page, usually in address bar appears IE
> > icon before the address. What I want is to substitute that icon to
> > another,
> > like happens when we visit, for example, http://www.codeproject.com .
> > How can I do that?
> > --
> > Programming ASP.NET with VB.NET
> > Thank's (if you try to help me)
> > Hope this help you (if I try to help you)
> > ruca
>
It works find in Opera and Mozila. IE has not caught up!
Set A Parameter Without Redirecting A Page?
without using response.redirect?
I am trying to set a parameter - ResponseId = 4 inside a while loop. is
this possible?
also, is it possible to replace the value of the ResponseId parameter
to, say "5" in the same way?
thanks!Querystring parameters cannot be reset dynamically as they represent a
read-only collection of items in the url.
Of course, something else you could do would be to have a series of local
variables or protected properties that would initially populate from this
list, then change the variable in postback. This would work nicely if you're
using AJAX because then you wouldn't be posting back the whole page. If
you're not using AJAX, then using a response.redirect doesn't effect you
much because you'll have a full page postback and might as well do the
redirect to avoid worrying about keeping parameter updates in a viewstate.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"pbd22" <dushkin@.gmail.comwrote in message
news:1167335417.354465.213040@.n51g2000cwc.googlegr oups.com...
Quote:
Originally Posted by
can somebody tell me how to set a parameter of my current URL
>
without using response.redirect?
>
I am trying to set a parameter - ResponseId = 4 inside a while loop. is
this possible?
>
also, is it possible to replace the value of the ResponseId parameter
to, say "5" in the same way?
>
thanks!
>
ok, thanks mark.
i dont think this will work as the updated parameter is created in a
while
loop that outputs many values - this is a count.
what i have done is pass my url querystring through a hidden iframe
from
the referring page (i am uploading files). now, what i want to do is
send a
count back to the referring page (the count represents upload time). i
thought i might be able to do this in the querystring but this would
cause
numerous postbacks in sequence - not pretty.
since it looks like doing it via the querystring is a no-go, do you
have any ideas how
i might send the upload count back to the referring page? is it
possible to send an ajax response from the server when the client does
not initiate the call?
thanks.
peter
Mark Fitzpatrick wrote:
Quote:
Originally Posted by
Querystring parameters cannot be reset dynamically as they represent a
read-only collection of items in the url.
>
Of course, something else you could do would be to have a series of local
variables or protected properties that would initially populate from this
list, then change the variable in postback. This would work nicely if you're
using AJAX because then you wouldn't be posting back the whole page. If
you're not using AJAX, then using a response.redirect doesn't effect you
much because you'll have a full page postback and might as well do the
redirect to avoid worrying about keeping parameter updates in a viewstate.
>
>
--
>
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
>
>
>
"pbd22" <dushkin@.gmail.comwrote in message
news:1167335417.354465.213040@.n51g2000cwc.googlegr oups.com...
Quote:
Originally Posted by
can somebody tell me how to set a parameter of my current URL
without using response.redirect?
I am trying to set a parameter - ResponseId = 4 inside a while loop. is
this possible?
also, is it possible to replace the value of the ResponseId parameter
to, say "5" in the same way?
thanks!
Set a session variable to pre defined value
<%# Session("var1") = "abc" %
Thanks
Julian ParkinsonYou've used adata binding expression, so it will only be called when DataBind() is called on the Page.
I think you want to use aninline code expression instead:
<% Session("var1") = "abc" %>Hi,
You need to put the Session variable in the Page_Load like this:
if(!Page.IsPostBack)
{Session["Name"] = "NewValue";
Response.Redirect("Mynewpage.aspx");}
And then in the Mynewpage.aspx you can recieve the session using this code in the Page_Load with not postback.
if(Session["Name"] == null )
Response.Redirect("LoginPage.aspx");else
Label1.Text = Session["Name"].ToString();
Dan,
Cheers for that. I just needed the remove the hash!! Duhh!
I'm moving from asp vb to asp.net vb and i'm finding it strange, some stuff is the same, some isn't sometimes I can't see the wood for the trees.
Thanks again.
Set a value to a hidden field in a web page
I have a problem when using a hidden field to send a value to the server.
Below you can see my code in simplyfied versions.
What I'm trying to do is:
1. The user browses for a picture at the network from their computer using
control File1.
2. The user clickes the button Commit picture (with id CliBtn)
a. The script is running at the client to get the sharename of the file
selected
b. The script should update a picture shown (the code below just shows
the label with the path)
c. The code-behind should then save all values in a database.
The problem appear when I'm trying to set the value to the hide control, so
I am doing something wrong.
I'm not so used to web developing, so please give me some help here, with
code please.
Regards Magnus
--
Code-behind page in C#
--
void Page_Load(object sender, EventArgs e)
{
HtmlInputHidden hide = new HtmlInputHidden();
hide.ID = "hide";
hide.Value = "Hidden Text";
sURL = Request.Form["hide"].ToString();
Label11.Text = sURL;
}
--
.ASPX page
--
<head>
<title>Untitled Page</title>
<script language=vbscript>
function getpicvb()
dim javatext
javatext = document.getElementById("File1").getAttribute("value")
dim fso
set FSO = CreateObject("Scripting.FileSystemObject")
dim drive
set drive =
FSO.GetDrive(FSO.GetDriveName(FSO.GetAbsolutePathName(javatext)))
javatext = drive.ShareName
'hide.value = javatext ' this row doesn't work
alert(javatext)
end function
</script>
</head>
<body>
<input id="File1" type="file" />
<input id="CliBtn" value="Commit picture" onclick="getpicvb() " type=submit
/>
<asp:Label ID="Label11" Runat="server" Text="Label"></asp:Label>
<input type=hidden id=hide />
</body>
----
---
"Brock Allen" <ballen@dotnet.itags.org.NOSPAMdevelop.com> wrote in message
news:444437632489320772241920@dotnet.itags.org.msnews.microsoft.com...
> Make a hidden field (via Page.RegisterHiddenField) and have the javascript
> write the value to the hidden. In the server, fetch the value via
Request.Form["YourFieldID"]
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>Controlled envionement ? What is the exact problme you have (you have always
"Hidden Text" server side ?
In particular fso is not supposed to work without tweaking security
settings. ARe you sure itjust doesn't fails silently...
Also you always change the value of the "hide" field when the page loads...
Try to do not "if (!Ispostback)"...
Patrice
"Magnus Blomberg" <magnus.blomberg@.skanska.se> a crit dans le message de
news:uTXsgPOQFHA.1528@.TK2MSFTNGP09.phx.gbl...
> Hello!
> I have a problem when using a hidden field to send a value to the server.
> Below you can see my code in simplyfied versions.
> What I'm trying to do is:
> 1. The user browses for a picture at the network from their computer using
> control File1.
> 2. The user clickes the button Commit picture (with id CliBtn)
> a. The script is running at the client to get the sharename of the
file
> selected
> b. The script should update a picture shown (the code below just shows
> the label with the path)
> c. The code-behind should then save all values in a database.
> The problem appear when I'm trying to set the value to the hide control,
so
> I am doing something wrong.
> I'm not so used to web developing, so please give me some help here, with
> code please.
> Regards Magnus
> --
> Code-behind page in C#
> --
> void Page_Load(object sender, EventArgs e)
> {
> HtmlInputHidden hide = new HtmlInputHidden();
> hide.ID = "hide";
> hide.Value = "Hidden Text";
> sURL = Request.Form["hide"].ToString();
> Label11.Text = sURL;
> }
> --
> .ASPX page
> --
> <head>
> <title>Untitled Page</title>
> <script language=vbscript>
> function getpicvb()
> dim javatext
> javatext = document.getElementById("File1").getAttribute("value")
> dim fso
> set FSO = CreateObject("Scripting.FileSystemObject")
> dim drive
> set drive =
> FSO.GetDrive(FSO.GetDriveName(FSO.GetAbsolutePathName(javatext)))
> javatext = drive.ShareName
> 'hide.value = javatext ' this row doesn't work
> alert(javatext)
> end function
> </script>
> </head>
> <body>
> <input id="File1" type="file" />
> <input id="CliBtn" value="Commit picture" onclick="getpicvb() "
type=submit
> />
> <asp:Label ID="Label11" Runat="server" Text="Label"></asp:Label>
> <input type=hidden id=hide />
> </body>
> ----
--
> ---
> "Brock Allen" <ballen@.NOSPAMdevelop.com> wrote in message
> news:444437632489320772241920@.msnews.microsoft.com...
javascript
> Request.Form["YourFieldID"]
>
>
Magnus what are u trying to do'
Vbscript,C#'?
*** Sent via Developersdex http://www.examnotes.net ***
Hello and thanks for your answer.
Well, I thought fso was not a common way to solve this, but since this is
for a Intranet, I think I can theak the security anyway. If you have a
better solution for this issue I'll be glad to here it.
I'm not sure what silent failure does mean, but I think that is what I get.
I get no error message, but the alert row is never executed when the
hide.value = javatext is run.
The problem does not appear when working with fso. It appears when trying to
set the hide object.
I am familiar to the (!IsPostBack) command, so I will take care of that in
my full code.
My code in this forum is shrinked.
Regards Magnus
"Patrice" <nobody@.nowhere.com> wrote in message
news:#Xio4aOQFHA.3076@.TK2MSFTNGP14.phx.gbl...
> Controlled envionement ? What is the exact problme you have (you have
always
> "Hidden Text" server side ?
> In particular fso is not supposed to work without tweaking security
> settings. ARe you sure itjust doesn't fails silently...
> Also you always change the value of the "hide" field when the page
loads...
> Try to do not "if (!Ispostback)"...
> Patrice
> --
> "Magnus Blomberg" <magnus.blomberg@.skanska.se> a crit dans le message de
> news:uTXsgPOQFHA.1528@.TK2MSFTNGP09.phx.gbl...
server.
using
> file
shows
> so
with
document.getElementById("File1").getAttribute("value")
> type=submit
> ----
> --
> javascript
This
basics?
>
Ok, so this line is never executed.
Check if the fso object is set. Do you have yet tweaked security ?
If I remember when security is not tweaked , it fails without any warning
(as anyway it 's not supposed to work).
What do you want to do ? You can use an input type=file to get the name
server side even if you don't want to upload this file. This way you
wouldn't need to copy this value in an hidden field.
Also I don't really see how it works. The server could perhaps not have the
same netwrok path available.
Depneidng on what you wan to do with this file, I would upload it server
file to do the intended processing...
Good luck
Patrice
"Magnus Blomberg" <magnus.blomberg@.skanska.se> a crit dans le message de
news:%23GCvfKPQFHA.3988@.tk2msftngp13.phx.gbl...
> Hello and thanks for your answer.
> Well, I thought fso was not a common way to solve this, but since this is
> for a Intranet, I think I can theak the security anyway. If you have a
> better solution for this issue I'll be glad to here it.
> I'm not sure what silent failure does mean, but I think that is what I
get.
> I get no error message, but the alert row is never executed when the
> hide.value = javatext is run.
> The problem does not appear when working with fso. It appears when trying
to
> set the hide object.
> I am familiar to the (!IsPostBack) command, so I will take care of that in
> my full code.
> My code in this forum is shrinked.
> Regards Magnus
>
> "Patrice" <nobody@.nowhere.com> wrote in message
> news:#Xio4aOQFHA.3076@.TK2MSFTNGP14.phx.gbl...
> always
> loads...
de
> server.
> using
> shows
control,
> with
> document.getElementById("File1").getAttribute("value")
> ----
> This
> basics?
>
Set a value to a hidden field in a web page
I have a problem when using a hidden field to send a value to the server.
Below you can see my code in simplyfied versions.
What I'm trying to do is:
1. The user browses for a picture at the network from their computer using
control File1.
2. The user clickes the button Commit picture (with id CliBtn)
a. The script is running at the client to get the sharename of the file
selected
b. The script should update a picture shown (the code below just shows
the label with the path)
c. The code-behind should then save all values in a database.
The problem appear when I'm trying to set the value to the hide control, so
I am doing something wrong.
I'm not so used to web developing, so please give me some help here, with
code please.
Regards Magnus
--------
Code-behind page in C#
--------
void Page_Load(object sender, EventArgs e)
{
HtmlInputHidden hide = new HtmlInputHidden();
hide.ID = "hide";
hide.Value = "Hidden Text";
sURL = Request.Form["hide"].ToString();
Label11.Text = sURL;
}
--------
..ASPX page
--------
<head>
<title>Untitled Page</title>
<script language=vbscript>
function getpicvb()
dim javatext
javatext = document.getElementById("File1").getAttribute("value")
dim fso
set FSO = CreateObject("Scripting.FileSystemObject")
dim drive
set drive =
FSO.GetDrive(FSO.GetDriveName(FSO.GetAbsolutePathN ame(javatext)))
javatext = drive.ShareName
'hide.value = javatext ' this row doesn't work
alert(javatext)
end function
</script>
</head>
<body>
<input id="File1" type="file" />
<input id="CliBtn" value="Commit picture" onclick="getpicvb() " type=submit
/>
<asp:Label ID="Label11" Runat="server" Text="Label"></asp:Label>
<input type=hidden id=hide />
</body>
-----------------------
---------------
"Brock Allen" <ballen@dotnet.itags.org.NOSPAMdevelop.com> wrote in message
news:444437632489320772241920@dotnet.itags.org.msnews.microsoft.com ...
> Make a hidden field (via Page.RegisterHiddenField) and have the javascript
> write the value to the hidden. In the server, fetch the value via
Request.Form["YourFieldID"]
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
> > Hello!
> > I have a client javascript that generates a string (like below). This
> > string should then be used by server code (in this case a function
> > called run).
> > <script language=javascript>
> > function getpic()
> > { string s;
> > s = document.getElementById("File1").getAttribute("value");
> > <% run(s); %>
> > }
> > I think this would be rather common, so maybe I'm missing some basics?
> > Regards MagnusControlled envionement ? What is the exact problme you have (you have always
"Hidden Text" server side ?
In particular fso is not supposed to work without tweaking security
settings. ARe you sure itjust doesn't fails silently...
Also you always change the value of the "hide" field when the page loads...
Try to do not "if (!Ispostback)"...
Patrice
--
"Magnus Blomberg" <magnus.blomberg@.skanska.se> a crit dans le message de
news:uTXsgPOQFHA.1528@.TK2MSFTNGP09.phx.gbl...
> Hello!
> I have a problem when using a hidden field to send a value to the server.
> Below you can see my code in simplyfied versions.
> What I'm trying to do is:
> 1. The user browses for a picture at the network from their computer using
> control File1.
> 2. The user clickes the button Commit picture (with id CliBtn)
> a. The script is running at the client to get the sharename of the
file
> selected
> b. The script should update a picture shown (the code below just shows
> the label with the path)
> c. The code-behind should then save all values in a database.
> The problem appear when I'm trying to set the value to the hide control,
so
> I am doing something wrong.
> I'm not so used to web developing, so please give me some help here, with
> code please.
> Regards Magnus
> --------
> Code-behind page in C#
> --------
> void Page_Load(object sender, EventArgs e)
> {
> HtmlInputHidden hide = new HtmlInputHidden();
> hide.ID = "hide";
> hide.Value = "Hidden Text";
> sURL = Request.Form["hide"].ToString();
> Label11.Text = sURL;
> }
> --------
> .ASPX page
> --------
> <head>
> <title>Untitled Page</title>
> <script language=vbscript>
> function getpicvb()
> dim javatext
> javatext = document.getElementById("File1").getAttribute("value")
> dim fso
> set FSO = CreateObject("Scripting.FileSystemObject")
> dim drive
> set drive =
> FSO.GetDrive(FSO.GetDriveName(FSO.GetAbsolutePathN ame(javatext)))
> javatext = drive.ShareName
> 'hide.value = javatext ' this row doesn't work
> alert(javatext)
> end function
> </script>
> </head>
> <body>
> <input id="File1" type="file" />
> <input id="CliBtn" value="Commit picture" onclick="getpicvb() "
type=submit
> />
> <asp:Label ID="Label11" Runat="server" Text="Label"></asp:Label>
> <input type=hidden id=hide />
> </body>
> -----------------------
--
> ---------------
> "Brock Allen" <ballen@.NOSPAMdevelop.com> wrote in message
> news:444437632489320772241920@.msnews.microsoft.com ...
> > Make a hidden field (via Page.RegisterHiddenField) and have the
javascript
> > write the value to the hidden. In the server, fetch the value via
> Request.Form["YourFieldID"]
> > -Brock
> > DevelopMentor
> > http://staff.develop.com/ballen
> > > Hello!
> > > > I have a client javascript that generates a string (like below). This
> > > string should then be used by server code (in this case a function
> > > called run).
> > > > <script language=javascript>
> > > function getpic()
> > > { string s;
> > > s = document.getElementById("File1").getAttribute("value");
> > > <% run(s); %>
> > > }
> > > I think this would be rather common, so maybe I'm missing some basics?
> > > Regards Magnus
>
Magnus what are u trying to do??
Vbscript,C#???
*** Sent via Developersdex http://www.developersdex.com ***
Hello and thanks for your answer.
Well, I thought fso was not a common way to solve this, but since this is
for a Intranet, I think I can theak the security anyway. If you have a
better solution for this issue I'll be glad to here it.
I'm not sure what silent failure does mean, but I think that is what I get.
I get no error message, but the alert row is never executed when the
hide.value = javatext is run.
The problem does not appear when working with fso. It appears when trying to
set the hide object.
I am familiar to the (!IsPostBack) command, so I will take care of that in
my full code.
My code in this forum is shrinked.
Regards Magnus
"Patrice" <nobody@.nowhere.com> wrote in message
news:#Xio4aOQFHA.3076@.TK2MSFTNGP14.phx.gbl...
> Controlled envionement ? What is the exact problme you have (you have
always
> "Hidden Text" server side ?
> In particular fso is not supposed to work without tweaking security
> settings. ARe you sure itjust doesn't fails silently...
> Also you always change the value of the "hide" field when the page
loads...
> Try to do not "if (!Ispostback)"...
> Patrice
> --
> "Magnus Blomberg" <magnus.blomberg@.skanska.se> a crit dans le message de
> news:uTXsgPOQFHA.1528@.TK2MSFTNGP09.phx.gbl...
> > Hello!
> > I have a problem when using a hidden field to send a value to the
server.
> > Below you can see my code in simplyfied versions.
> > What I'm trying to do is:
> > 1. The user browses for a picture at the network from their computer
using
> > control File1.
> > 2. The user clickes the button Commit picture (with id CliBtn)
> > a. The script is running at the client to get the sharename of the
> file
> > selected
> > b. The script should update a picture shown (the code below just
shows
> > the label with the path)
> > c. The code-behind should then save all values in a database.
> > The problem appear when I'm trying to set the value to the hide control,
> so
> > I am doing something wrong.
> > I'm not so used to web developing, so please give me some help here,
with
> > code please.
> > Regards Magnus
> > --------
> > Code-behind page in C#
> > --------
> > void Page_Load(object sender, EventArgs e)
> > {
> > HtmlInputHidden hide = new HtmlInputHidden();
> > hide.ID = "hide";
> > hide.Value = "Hidden Text";
> > sURL = Request.Form["hide"].ToString();
> > Label11.Text = sURL;
> > }
> > --------
> > .ASPX page
> > --------
> > <head>
> > <title>Untitled Page</title>
> > <script language=vbscript>
> > function getpicvb()
> > dim javatext
> > javatext =
document.getElementById("File1").getAttribute("value")
> > dim fso
> > set FSO = CreateObject("Scripting.FileSystemObject")
> > dim drive
> > set drive =
> > FSO.GetDrive(FSO.GetDriveName(FSO.GetAbsolutePathN ame(javatext)))
> > javatext = drive.ShareName
> > 'hide.value = javatext ' this row doesn't work
> > alert(javatext)
> > end function
> > </script>
> > </head>
> > <body>
> > <input id="File1" type="file" />
> > <input id="CliBtn" value="Commit picture" onclick="getpicvb() "
> type=submit
> > />
> > <asp:Label ID="Label11" Runat="server" Text="Label"></asp:Label>
> > <input type=hidden id=hide />
> > </body>
> -----------------------
> --
> > ---------------
> > "Brock Allen" <ballen@.NOSPAMdevelop.com> wrote in message
> > news:444437632489320772241920@.msnews.microsoft.com ...
> > > Make a hidden field (via Page.RegisterHiddenField) and have the
> javascript
> > > write the value to the hidden. In the server, fetch the value via
> > Request.Form["YourFieldID"]
> > > > -Brock
> > > DevelopMentor
> > > http://staff.develop.com/ballen
> > > > > > > Hello!
> > > > > > I have a client javascript that generates a string (like below).
This
> > > > string should then be used by server code (in this case a function
> > > > called run).
> > > > > > <script language=javascript>
> > > > function getpic()
> > > > { string s;
> > > > s = document.getElementById("File1").getAttribute("value");
> > > > <% run(s); %>
> > > > }
> > > > I think this would be rather common, so maybe I'm missing some
basics?
> > > > Regards Magnus
> > > > >
Ok, so this line is never executed.
Check if the fso object is set. Do you have yet tweaked security ?
If I remember when security is not tweaked , it fails without any warning
(as anyway it 's not supposed to work).
What do you want to do ? You can use an input type=file to get the name
server side even if you don't want to upload this file. This way you
wouldn't need to copy this value in an hidden field.
Also I don't really see how it works. The server could perhaps not have the
same netwrok path available.
Depneidng on what you wan to do with this file, I would upload it server
file to do the intended processing...
Good luck
Patrice
--
"Magnus Blomberg" <magnus.blomberg@.skanska.se> a crit dans le message de
news:%23GCvfKPQFHA.3988@.tk2msftngp13.phx.gbl...
> Hello and thanks for your answer.
> Well, I thought fso was not a common way to solve this, but since this is
> for a Intranet, I think I can theak the security anyway. If you have a
> better solution for this issue I'll be glad to here it.
> I'm not sure what silent failure does mean, but I think that is what I
get.
> I get no error message, but the alert row is never executed when the
> hide.value = javatext is run.
> The problem does not appear when working with fso. It appears when trying
to
> set the hide object.
> I am familiar to the (!IsPostBack) command, so I will take care of that in
> my full code.
> My code in this forum is shrinked.
> Regards Magnus
>
> "Patrice" <nobody@.nowhere.com> wrote in message
> news:#Xio4aOQFHA.3076@.TK2MSFTNGP14.phx.gbl...
> > Controlled envionement ? What is the exact problme you have (you have
> always
> > "Hidden Text" server side ?
> > In particular fso is not supposed to work without tweaking security
> > settings. ARe you sure itjust doesn't fails silently...
> > Also you always change the value of the "hide" field when the page
> loads...
> > Try to do not "if (!Ispostback)"...
> > Patrice
> > --
> > "Magnus Blomberg" <magnus.blomberg@.skanska.se> a crit dans le message
de
> > news:uTXsgPOQFHA.1528@.TK2MSFTNGP09.phx.gbl...
> > > Hello!
> > > > I have a problem when using a hidden field to send a value to the
> server.
> > > Below you can see my code in simplyfied versions.
> > > > What I'm trying to do is:
> > > 1. The user browses for a picture at the network from their computer
> using
> > > control File1.
> > > 2. The user clickes the button Commit picture (with id CliBtn)
> > > a. The script is running at the client to get the sharename of the
> > file
> > > selected
> > > b. The script should update a picture shown (the code below just
> shows
> > > the label with the path)
> > > c. The code-behind should then save all values in a database.
> > > > The problem appear when I'm trying to set the value to the hide
control,
> > so
> > > I am doing something wrong.
> > > I'm not so used to web developing, so please give me some help here,
> with
> > > code please.
> > > > Regards Magnus
> > > --------
> > > Code-behind page in C#
> > > --------
> > > void Page_Load(object sender, EventArgs e)
> > > {
> > > HtmlInputHidden hide = new HtmlInputHidden();
> > > hide.ID = "hide";
> > > hide.Value = "Hidden Text";
> > > sURL = Request.Form["hide"].ToString();
> > > Label11.Text = sURL;
> > > }
> > > --------
> > > .ASPX page
> > > --------
> > > <head>
> > > <title>Untitled Page</title>
> > > <script language=vbscript>
> > > function getpicvb()
> > > dim javatext
> > > javatext =
> document.getElementById("File1").getAttribute("value")
> > > dim fso
> > > set FSO = CreateObject("Scripting.FileSystemObject")
> > > dim drive
> > > set drive =
> > > FSO.GetDrive(FSO.GetDriveName(FSO.GetAbsolutePathN ame(javatext)))
> > > javatext = drive.ShareName
> > > 'hide.value = javatext ' this row doesn't work
> > > alert(javatext)
> > > end function
> > > </script>
> > > </head>
> > > <body>
> > > <input id="File1" type="file" />
> > > <input id="CliBtn" value="Commit picture" onclick="getpicvb() "
> > type=submit
> > > />
> > > <asp:Label ID="Label11" Runat="server" Text="Label"></asp:Label>
> > > <input type=hidden id=hide />
> > > </body>
> -----------------------
> > --
> > > ---------------
> > > "Brock Allen" <ballen@.NOSPAMdevelop.com> wrote in message
> > > news:444437632489320772241920@.msnews.microsoft.com ...
> > > > Make a hidden field (via Page.RegisterHiddenField) and have the
> > javascript
> > > > write the value to the hidden. In the server, fetch the value via
> > > Request.Form["YourFieldID"]
> > > > > > -Brock
> > > > DevelopMentor
> > > > http://staff.develop.com/ballen
> > > > > > > > > > > Hello!
> > > > > > > > I have a client javascript that generates a string (like below).
> This
> > > > > string should then be used by server code (in this case a function
> > > > > called run).
> > > > > > > > <script language=javascript>
> > > > > function getpic()
> > > > > { string s;
> > > > > s = document.getElementById("File1").getAttribute("value");
> > > > > <% run(s); %>
> > > > > }
> > > > > I think this would be rather common, so maybe I'm missing some
> basics?
> > > > > Regards Magnus
> > > > > > > > > > > >
Set as Start Page..
Most likely the .csproj or .vbproj file. It has no impact when you deploy your app. Strictly used for debugging inside VS.Net
Strictly used for debugging inside VS.Net
Oh, okay. That's what I needed to know! Thanks!
If you look in your documents and settings folder, there is a VSWebCache Folder. Each web application will have a folder and in there you'll find a file like WebApplication1.vbproj.user that contains all the user settings like start page.
Set As Start Page
Can someone tell me why when I go to the Solution Explorer and try to set a
certain aspx page as the start page (Set As Start Page), it is grayed out?
Thanks :)Randy wrote:
> Hello All,
> Can someone tell me why when I go to the Solution Explorer and try to set
a
> certain aspx page as the start page (Set As Start Page), it is grayed out?
> Thanks :)
>
Some are, some aren't? or are you saying that option is always greyed out?
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Are you clicking on a file that can be set as a Start Page.
If i click on a .cs page, or a .ascx page, mine is also grayed out.
But when i right click on an .aspx page or .htm page it is not.
Just ensure your trying to set a valid page as a start page, and not a
invalid page like a control, config or class
"Randy" <temp@.temp.com> wrote in message
news:%23ERiqnPmFHA.3960@.TK2MSFTNGP12.phx.gbl...
> Hello All,
> Can someone tell me why when I go to the Solution Explorer and try to set
> a certain aspx page as the start page (Set As Start Page), it is grayed
> out?
> Thanks :)
>
Yes, you're right. I was asking for someone. What they did was add the .cs
files to the project and they were trying to right click on one of them to
Set As Start Page. I'm getting her to Exclude the .cs files and add the
.aspx files. I'm thinking that should do it. Thanks for your help.
"Grant Merwitz" <grant@.workshare.com> wrote in message
news:uT3rSrPmFHA.572@.TK2MSFTNGP15.phx.gbl...
> Are you clicking on a file that can be set as a Start Page.
> If i click on a .cs page, or a .ascx page, mine is also grayed out.
> But when i right click on an .aspx page or .htm page it is not.
> Just ensure your trying to set a valid page as a start page, and not a
> invalid page like a control, config or class
> "Randy" <temp@.temp.com> wrote in message
> news:%23ERiqnPmFHA.3960@.TK2MSFTNGP12.phx.gbl...
>
I was asking for a friend. I think she added the .cs files to the project
instead of the .aspx.
Thanks
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:ehL0xpPmFHA.2920@.TK2MSFTNGP14.phx.gbl...
> Randy wrote:
> Some are, some aren't? or are you saying that option is always greyed out?
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
well, smack yout friend on the hand and say "Bad Friend" :)
Just kidding.
"Randy" <temp@.temp.com> wrote in message
news:%23%23NFX%23PmFHA.4000@.TK2MSFTNGP12.phx.gbl...
> Yes, you're right. I was asking for someone. What they did was add the .cs
> files to the project and they were trying to right click on one of them to
> Set As Start Page. I'm getting her to Exclude the .cs files and add the
> .aspx files. I'm thinking that should do it. Thanks for your help.
>
> "Grant Merwitz" <grant@.workshare.com> wrote in message
> news:uT3rSrPmFHA.572@.TK2MSFTNGP15.phx.gbl...
>
Randy wrote:
> I was asking for a friend. I think she added the .cs files to the project
> instead of the .aspx.
That'll do it. :}
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Set As Start Page
Can someone tell me why when I go to the Solution Explorer and try to set a
certain aspx page as the start page (Set As Start Page), it is grayed out?
Thanks :)Randy wrote:
> Hello All,
> Can someone tell me why when I go to the Solution Explorer and try to set a
> certain aspx page as the start page (Set As Start Page), it is grayed out?
> Thanks :)
Some are, some aren't? or are you saying that option is always greyed out?
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Are you clicking on a file that can be set as a Start Page.
If i click on a .cs page, or a .ascx page, mine is also grayed out.
But when i right click on an .aspx page or .htm page it is not.
Just ensure your trying to set a valid page as a start page, and not a
invalid page like a control, config or class
"Randy" <temp@.temp.com> wrote in message
news:%23ERiqnPmFHA.3960@.TK2MSFTNGP12.phx.gbl...
> Hello All,
> Can someone tell me why when I go to the Solution Explorer and try to set
> a certain aspx page as the start page (Set As Start Page), it is grayed
> out?
> Thanks :)
Yes, you're right. I was asking for someone. What they did was add the .cs
files to the project and they were trying to right click on one of them to
Set As Start Page. I'm getting her to Exclude the .cs files and add the
..aspx files. I'm thinking that should do it. Thanks for your help.
"Grant Merwitz" <grant@.workshare.com> wrote in message
news:uT3rSrPmFHA.572@.TK2MSFTNGP15.phx.gbl...
> Are you clicking on a file that can be set as a Start Page.
> If i click on a .cs page, or a .ascx page, mine is also grayed out.
> But when i right click on an .aspx page or .htm page it is not.
> Just ensure your trying to set a valid page as a start page, and not a
> invalid page like a control, config or class
> "Randy" <temp@.temp.com> wrote in message
> news:%23ERiqnPmFHA.3960@.TK2MSFTNGP12.phx.gbl...
>> Hello All,
>> Can someone tell me why when I go to the Solution Explorer and try to set
>> a certain aspx page as the start page (Set As Start Page), it is grayed
>> out?
>>
>> Thanks :)
>>
I was asking for a friend. I think she added the .cs files to the project
instead of the .aspx.
Thanks
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:ehL0xpPmFHA.2920@.TK2MSFTNGP14.phx.gbl...
> Randy wrote:
>> Hello All,
>> Can someone tell me why when I go to the Solution Explorer and try to set
>> a certain aspx page as the start page (Set As Start Page), it is grayed
>> out?
>>
>> Thanks :)
> Some are, some aren't? or are you saying that option is always greyed out?
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
well, smack yout friend on the hand and say "Bad Friend" :)
Just kidding.
"Randy" <temp@.temp.com> wrote in message
news:%23%23NFX%23PmFHA.4000@.TK2MSFTNGP12.phx.gbl.. .
> Yes, you're right. I was asking for someone. What they did was add the .cs
> files to the project and they were trying to right click on one of them to
> Set As Start Page. I'm getting her to Exclude the .cs files and add the
> .aspx files. I'm thinking that should do it. Thanks for your help.
>
> "Grant Merwitz" <grant@.workshare.com> wrote in message
> news:uT3rSrPmFHA.572@.TK2MSFTNGP15.phx.gbl...
>> Are you clicking on a file that can be set as a Start Page.
>>
>> If i click on a .cs page, or a .ascx page, mine is also grayed out.
>>
>> But when i right click on an .aspx page or .htm page it is not.
>>
>> Just ensure your trying to set a valid page as a start page, and not a
>> invalid page like a control, config or class
>>
>> "Randy" <temp@.temp.com> wrote in message
>> news:%23ERiqnPmFHA.3960@.TK2MSFTNGP12.phx.gbl...
>>> Hello All,
>>> Can someone tell me why when I go to the Solution Explorer and try to
>>> set a certain aspx page as the start page (Set As Start Page), it is
>>> grayed out?
>>>
>>> Thanks :)
>>>
>>
>>
Randy wrote:
> I was asking for a friend. I think she added the .cs files to the project
> instead of the .aspx.
That'll do it. :}
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Set Background Color Using Column Value?
table on a web page which contains info about paint colors. One column
contains the hex value for the color's RGB value. I want to display
info from the table in a grid or table and use the column value from
the RGBHex column to set each row's back ground color. I can just
about do this in my sleep in old style ASP using <%%> tags but I would
like to implement it in .NET 2. My website has this implemented in
old ASP here: www.paintmatcher.com/tool/tool.asp Any help is greatly
appreciated.On Mar 17, 1:26 pm, "TF" <TJForw...@.gmail.com> wrote:
> the RGBHex column to set each row's back ground color. I can just
> about do this in my sleep in old style ASP using <%%> tags
it could be the same as in ASP 3:
bgcolor="#<%=hex_value%>"
where "hex_value" is a variable
Here's a snippet of the code created by MS Vis Web Developer 05
Express. The data from the table displays just fine. I want to set
the back color of each row based on the value of the "RGBHex" field.
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="AccessDataSource2"
EmptyDataText="There are no data records to
display.">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Brand" HeaderText="Brand"
SortExpression="Brand" />
<asp:BoundField DataField="Colorname"
HeaderText="Colorname" SortExpression="Colorname" />
<asp:BoundField DataField="RGBValue" HeaderText="RGBValue"
SortExpression="RGBValue" />
<asp:BoundField DataField="RGBHex" HeaderText="RGBHex"
SortExpression="RGBHex" />
</Columns>
</asp:GridView>
Could I use ASP 3 <%%> tags inside the BoundField tag? How would I
call the field value using ASP.NET to assign to the variable? Or
maybe there's a better solution than using a GridView. Any other
ideas?
Thanks.
Alexey Smirnov wrote:
> On Mar 17, 1:26 pm, "TF" <TJForw...@.gmail.com> wrote:
> it could be the same as in ASP 3:
> bgcolor="#<%=hex_value%>"
> where "hex_value" is a variable
More see here!
http://www.flash50.com/index.php
On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.com> wrote:
> Here's a snippet of the code created by MS Vis Web Developer 05
> Express. The data from the table displays just fine. I want to set
> the back color of each row based on the value of the "RGBHex" field.
> <asp:GridView ID="GridView1" runat="server" AllowSorting="True"
> AutoGenerateColumns="False"
> DataKeyNames="ID" DataSourceID="AccessDataSource2"
> EmptyDataText="There are no data records to
> display.">
> <Columns>
> <asp:BoundField DataField="ID" HeaderText="ID"
> ReadOnly="True" SortExpression="ID" />
> <asp:BoundField DataField="Brand" HeaderText="Brand"
> SortExpression="Brand" />
> <asp:BoundField DataField="Colorname"
> HeaderText="Colorname" SortExpression="Colorname" />
> <asp:BoundField DataField="RGBValue" HeaderText="RGBValue"
> SortExpression="RGBValue" />
> <asp:BoundField DataField="RGBHex" HeaderText="RGBHex"
> SortExpression="RGBHex" />
> </Columns>
> </asp:GridView>
> Could I use ASP 3 <%%> tags inside the BoundField tag? How would I
> call the field value using ASP.NET to assign to the variable? Or
> maybe there's a better solution than using a GridView. Any other
> ideas?
>
In this case you should rewrite a GridView_RowDataBound event.
Change <asp:GridView ID="GridView1"
OnRowDataBound="GridView1_RowDataBound"...
and add the GridView1_RowDataBound event to your code (code-behind)
C#:
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
}
}
I didn't test it but it should work, I think
On Mar 18, 4:20 am, "Alexey Smirnov" <alexey.smir...@.gmail.com> wrote:
> On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.com> wrote:
>
>
>
>
> In this case you should rewrite a GridView_RowDataBound event.
> Change <asp:GridView ID="GridView1"
> OnRowDataBound="GridView1_RowDataBound"...
> and add the GridView1_RowDataBound event to your code (code-behind)
> C#:
> protected void GridView1_RowDataBound(object sender,
> GridViewRowEventArgs e)
> {
> if (e.Row.RowType == DataControlRowType.DataRow)
> {
> string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
> e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
> }
> }
> I didn't test it but it should work, I think
OK. Where do I put that C# code snippet?
On Mar 18, 4:20 am, "Alexey Smirnov" <alexey.smir...@.gmail.com> wrote:
> On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.com> wrote:
>
>
>
>
> In this case you should rewrite a GridView_RowDataBound event.
> Change <asp:GridView ID="GridView1"
> OnRowDataBound="GridView1_RowDataBound"...
> and add the GridView1_RowDataBound event to your code (code-behind)
> C#:
> protected void GridView1_RowDataBound(object sender,
> GridViewRowEventArgs e)
> {
> if (e.Row.RowType == DataControlRowType.DataRow)
> {
> string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
> e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
> }
> }
> I didn't test it but it should work, I think
OK. Where do I put that C# code snippet?
On Mar 18, 4:20 am, "Alexey Smirnov" <alexey.smir...@.gmail.com> wrote:
> On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.com> wrote:
>
>
>
>
> In this case you should rewrite a GridView_RowDataBound event.
> Change <asp:GridView ID="GridView1"
> OnRowDataBound="GridView1_RowDataBound"...
> and add the GridView1_RowDataBound event to your code (code-behind)
> C#:
> protected void GridView1_RowDataBound(object sender,
> GridViewRowEventArgs e)
> {
> if (e.Row.RowType == DataControlRowType.DataRow)
> {
> string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
> e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
> }
> }
> I didn't test it but it should work, I think
OK. Where do I put that C# code snippet?
On Mar 18, 4:20 am, "Alexey Smirnov" <alexey.smir...@.gmail.com> wrote:
> On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.com> wrote:
>
>
>
>
> In this case you should rewrite a GridView_RowDataBound event.
> Change <asp:GridView ID="GridView1"
> OnRowDataBound="GridView1_RowDataBound"...
> and add the GridView1_RowDataBound event to your code (code-behind)
> C#:
> protected void GridView1_RowDataBound(object sender,
> GridViewRowEventArgs e)
> {
> if (e.Row.RowType == DataControlRowType.DataRow)
> {
> string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
> e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
> }
> }
> I didn't test it but it should work, I think
OK. I may be getting this now. I made this the first line of my
default.aspx.
<%@. Page Language="C#" AutoEventWireup="false"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
And this is the contents of the default.aspx.cs file. Renamed my grid
GridView2 by the way.
protected void GridView2_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c = e.Row.DataItem["RGBHex"];
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
}
}
Getting these compilation errors.
c:\...Default.aspx.cs(1,11): error CS1518: Expected class, delegate,
enum, interface, or struct
c:\...Default.aspx.cs(6,27): error CS1001: Identifier expected
c:\...Default.aspx.cs(9,1): error CS1022: Type or namespace
definition, or end-of-file expected
I feel like I'm getting close but I just can't get it. Thank you for
your help.
TF
On Mar 18, 9:24 pm, "TF" <TJForw...@.gmail.com> wrote:
> On Mar 18, 4:20 am, "Alexey Smirnov" <alexey.smir...@.gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> OK. I may be getting this now. I made this the first line of my
> default.aspx.
> <%@. Page Language="C#" AutoEventWireup="false"
> CodeFile="Default.aspx.cs" Inherits="_Default" %>
> And this is the contents of the default.aspx.cs file. Renamed my grid
> GridView2 by the way.
> protected void GridView2_RowDataBound(object sender,
> GridViewRowEventArgs e)
> {
> if (e.Row.RowType == DataControlRowType.DataRow)
> {
> string c = e.Row.DataItem["RGBHex"];
> e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
> }
> }
> Getting these compilation errors.
> c:\...Default.aspx.cs(1,11): error CS1518: Expected class, delegate,
> enum, interface, or struct
> c:\...Default.aspx.cs(6,27): error CS1001: Identifier expected
> c:\...Default.aspx.cs(9,1): error CS1022: Type or namespace
> definition, or end-of-file expected
> I feel like I'm getting close but I just can't get it. Thank you for
> your help.
> TF- Hide quoted text -
> - Show quoted text -
Mate, you have to start from the basic.
It told you that you miss a class, that is you have to define the
_Default
Remember, you said <%@. Page ... Inherits="_Default"
<!-- This is the name of your class
So, the code-behind should be like this:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
..............code here...............
}
Set Background Color Using Column Value?
table on a web page which contains info about paint colors. One column
contains the hex value for the color's RGB value. I want to display
info from the table in a grid or table and use the column value from
the RGBHex column to set each row's back ground color. I can just
about do this in my sleep in old style ASP using <%%tags but I would
like to implement it in .NET 2. My website has this implemented in
old ASP here: www.paintmatcher.com/tool/tool.asp Any help is greatly
appreciated.On Mar 17, 1:26 pm, "TF" <TJForw...@.gmail.comwrote:
Quote:
Originally Posted by
the RGBHex column to set each row's back ground color. I can just
about do this in my sleep in old style ASP using <%%tags
it could be the same as in ASP 3:
bgcolor="#<%=hex_value%>"
where "hex_value" is a variable
Here's a snippet of the code created by MS Vis Web Developer 05
Express. The data from the table displays just fine. I want to set
the back color of each row based on the value of the "RGBHex" field.
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="AccessDataSource2"
EmptyDataText="There are no data records to
display.">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Brand" HeaderText="Brand"
SortExpression="Brand" />
<asp:BoundField DataField="Colorname"
HeaderText="Colorname" SortExpression="Colorname" />
<asp:BoundField DataField="RGBValue" HeaderText="RGBValue"
SortExpression="RGBValue" />
<asp:BoundField DataField="RGBHex" HeaderText="RGBHex"
SortExpression="RGBHex" />
</Columns>
</asp:GridView>
Could I use ASP 3 <%%tags inside the BoundField tag? How would I
call the field value using ASP.NET to assign to the variable? Or
maybe there's a better solution than using a GridView. Any other
ideas?
Thanks.
Alexey Smirnov wrote:
Quote:
Originally Posted by
On Mar 17, 1:26 pm, "TF" <TJForw...@.gmail.comwrote:
Quote:
Originally Posted by
the RGBHex column to set each row's back ground color. I can just
about do this in my sleep in old style ASP using <%%tags
>
it could be the same as in ASP 3:
>
bgcolor="#<%=hex_value%>"
>
where "hex_value" is a variable
More see here!
http://www.flash50.com/index.php
On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.comwrote:
Quote:
Originally Posted by
Here's a snippet of the code created by MS Vis Web Developer 05
Express. The data from the table displays just fine. I want to set
the back color of each row based on the value of the "RGBHex" field.
>
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="AccessDataSource2"
EmptyDataText="There are no data records to
display.">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Brand" HeaderText="Brand"
SortExpression="Brand" />
<asp:BoundField DataField="Colorname"
HeaderText="Colorname" SortExpression="Colorname" />
<asp:BoundField DataField="RGBValue" HeaderText="RGBValue"
SortExpression="RGBValue" />
<asp:BoundField DataField="RGBHex" HeaderText="RGBHex"
SortExpression="RGBHex" />
</Columns>
</asp:GridView>
>
Could I use ASP 3 <%%tags inside the BoundField tag? How would I
call the field value using ASP.NET to assign to the variable? Or
maybe there's a better solution than using a GridView. Any other
ideas?
>
In this case you should rewrite a GridView_RowDataBound event.
Change <asp:GridView ID="GridView1"
OnRowDataBound="GridView1_RowDataBound"...
and add the GridView1_RowDataBound event to your code (code-behind)
C#:
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
}
}
I didn't test it but it should work, I think
On Mar 18, 4:20 am, "Alexey Smirnov" <alexey.smir...@.gmail.comwrote:
Quote:
Originally Posted by
On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.comwrote:
>
>
>
Quote:
Originally Posted by
Here's a snippet of the code created by MS Vis Web Developer 05
Express. The data from the table displays just fine. I want to set
the back color of each row based on the value of the "RGBHex" field.
>
Quote:
Originally Posted by
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="AccessDataSource2"
EmptyDataText="There are no data records to
display.">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Brand" HeaderText="Brand"
SortExpression="Brand" />
<asp:BoundField DataField="Colorname"
HeaderText="Colorname" SortExpression="Colorname" />
<asp:BoundField DataField="RGBValue" HeaderText="RGBValue"
SortExpression="RGBValue" />
<asp:BoundField DataField="RGBHex" HeaderText="RGBHex"
SortExpression="RGBHex" />
</Columns>
</asp:GridView>
>
Quote:
Originally Posted by
Could I use ASP 3 <%%tags inside the BoundField tag? How would I
call the field value using ASP.NET to assign to the variable? Or
maybe there's a better solution than using a GridView. Any other
ideas?
>
In this case you should rewrite a GridView_RowDataBound event.
>
Change <asp:GridView ID="GridView1"
OnRowDataBound="GridView1_RowDataBound"...
>
and add the GridView1_RowDataBound event to your code (code-behind)
>
C#:
>
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
>
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
>
}
}
>
I didn't test it but it should work, I think
OK. Where do I put that C# code snippet?
On Mar 18, 4:20 am, "Alexey Smirnov" <alexey.smir...@.gmail.comwrote:
Quote:
Originally Posted by
On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.comwrote:
>
>
>
Quote:
Originally Posted by
Here's a snippet of the code created by MS Vis Web Developer 05
Express. The data from the table displays just fine. I want to set
the back color of each row based on the value of the "RGBHex" field.
>
Quote:
Originally Posted by
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="AccessDataSource2"
EmptyDataText="There are no data records to
display.">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Brand" HeaderText="Brand"
SortExpression="Brand" />
<asp:BoundField DataField="Colorname"
HeaderText="Colorname" SortExpression="Colorname" />
<asp:BoundField DataField="RGBValue" HeaderText="RGBValue"
SortExpression="RGBValue" />
<asp:BoundField DataField="RGBHex" HeaderText="RGBHex"
SortExpression="RGBHex" />
</Columns>
</asp:GridView>
>
Quote:
Originally Posted by
Could I use ASP 3 <%%tags inside the BoundField tag? How would I
call the field value using ASP.NET to assign to the variable? Or
maybe there's a better solution than using a GridView. Any other
ideas?
>
In this case you should rewrite a GridView_RowDataBound event.
>
Change <asp:GridView ID="GridView1"
OnRowDataBound="GridView1_RowDataBound"...
>
and add the GridView1_RowDataBound event to your code (code-behind)
>
C#:
>
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
>
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
>
}
}
>
I didn't test it but it should work, I think
OK. Where do I put that C# code snippet?
On Mar 18, 4:20 am, "Alexey Smirnov" <alexey.smir...@.gmail.comwrote:
Quote:
Originally Posted by
On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.comwrote:
>
>
>
Quote:
Originally Posted by
Here's a snippet of the code created by MS Vis Web Developer 05
Express. The data from the table displays just fine. I want to set
the back color of each row based on the value of the "RGBHex" field.
>
Quote:
Originally Posted by
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="AccessDataSource2"
EmptyDataText="There are no data records to
display.">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Brand" HeaderText="Brand"
SortExpression="Brand" />
<asp:BoundField DataField="Colorname"
HeaderText="Colorname" SortExpression="Colorname" />
<asp:BoundField DataField="RGBValue" HeaderText="RGBValue"
SortExpression="RGBValue" />
<asp:BoundField DataField="RGBHex" HeaderText="RGBHex"
SortExpression="RGBHex" />
</Columns>
</asp:GridView>
>
Quote:
Originally Posted by
Could I use ASP 3 <%%tags inside the BoundField tag? How would I
call the field value using ASP.NET to assign to the variable? Or
maybe there's a better solution than using a GridView. Any other
ideas?
>
In this case you should rewrite a GridView_RowDataBound event.
>
Change <asp:GridView ID="GridView1"
OnRowDataBound="GridView1_RowDataBound"...
>
and add the GridView1_RowDataBound event to your code (code-behind)
>
C#:
>
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
>
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
>
}
}
>
I didn't test it but it should work, I think
OK. Where do I put that C# code snippet?
On Mar 18, 4:20 am, "Alexey Smirnov" <alexey.smir...@.gmail.comwrote:
Quote:
Originally Posted by
On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.comwrote:
>
>
>
Quote:
Originally Posted by
Here's a snippet of the code created by MS Vis Web Developer 05
Express. The data from the table displays just fine. I want to set
the back color of each row based on the value of the "RGBHex" field.
>
Quote:
Originally Posted by
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="AccessDataSource2"
EmptyDataText="There are no data records to
display.">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Brand" HeaderText="Brand"
SortExpression="Brand" />
<asp:BoundField DataField="Colorname"
HeaderText="Colorname" SortExpression="Colorname" />
<asp:BoundField DataField="RGBValue" HeaderText="RGBValue"
SortExpression="RGBValue" />
<asp:BoundField DataField="RGBHex" HeaderText="RGBHex"
SortExpression="RGBHex" />
</Columns>
</asp:GridView>
>
Quote:
Originally Posted by
Could I use ASP 3 <%%tags inside the BoundField tag? How would I
call the field value using ASP.NET to assign to the variable? Or
maybe there's a better solution than using a GridView. Any other
ideas?
>
In this case you should rewrite a GridView_RowDataBound event.
>
Change <asp:GridView ID="GridView1"
OnRowDataBound="GridView1_RowDataBound"...
>
and add the GridView1_RowDataBound event to your code (code-behind)
>
C#:
>
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
>
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
>
}
}
>
I didn't test it but it should work, I think
OK. I may be getting this now. I made this the first line of my
default.aspx.
<%@. Page Language="C#" AutoEventWireup="false"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
And this is the contents of the default.aspx.cs file. Renamed my grid
GridView2 by the way.
protected void GridView2_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c = e.Row.DataItem["RGBHex"];
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
}
}
Getting these compilation errors.
c:\...Default.aspx.cs(1,11): error CS1518: Expected class, delegate,
enum, interface, or struct
c:\...Default.aspx.cs(6,27): error CS1001: Identifier expected
c:\...Default.aspx.cs(9,1): error CS1022: Type or namespace
definition, or end-of-file expected
I feel like I'm getting close but I just can't get it. Thank you for
your help.
TF
On Mar 18, 9:24 pm, "TF" <TJForw...@.gmail.comwrote:
Quote:
Originally Posted by
On Mar 18, 4:20 am, "Alexey Smirnov" <alexey.smir...@.gmail.comwrote:
>
>
>
>
>
Quote:
Originally Posted by
On Mar 17, 10:26 pm, "TF" <TJForw...@.gmail.comwrote:
>
Quote:
Originally Posted by
Quote:
Originally Posted by
Here's a snippet of the code created by MS Vis Web Developer 05
Express. The data from the table displays just fine. I want to set
the back color of each row based on the value of the "RGBHex" field.
>
Quote:
Originally Posted by
Quote:
Originally Posted by
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="AccessDataSource2"
EmptyDataText="There are no data records to
display.">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Brand" HeaderText="Brand"
SortExpression="Brand" />
<asp:BoundField DataField="Colorname"
HeaderText="Colorname" SortExpression="Colorname" />
<asp:BoundField DataField="RGBValue" HeaderText="RGBValue"
SortExpression="RGBValue" />
<asp:BoundField DataField="RGBHex" HeaderText="RGBHex"
SortExpression="RGBHex" />
</Columns>
</asp:GridView>
>
Quote:
Originally Posted by
Quote:
Originally Posted by
Could I use ASP 3 <%%tags inside the BoundField tag? How would I
call the field value using ASP.NET to assign to the variable? Or
maybe there's a better solution than using a GridView. Any other
ideas?
>
Quote:
Originally Posted by
In this case you should rewrite a GridView_RowDataBound event.
>
Quote:
Originally Posted by
Change <asp:GridView ID="GridView1"
OnRowDataBound="GridView1_RowDataBound"...
>
Quote:
Originally Posted by
and add the GridView1_RowDataBound event to your code (code-behind)
>
Quote:
Originally Posted by
C#:
>
Quote:
Originally Posted by
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
>
Quote:
Originally Posted by
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c = e.Row.DataItem["RGBHex"]; // e.g. "#000000"
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
>
Quote:
Originally Posted by
}
}
>
Quote:
Originally Posted by
I didn't test it but it should work, I think
>
OK. I may be getting this now. I made this the first line of my
default.aspx.
>
<%@. Page Language="C#" AutoEventWireup="false"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
>
And this is the contents of the default.aspx.cs file. Renamed my grid
GridView2 by the way.
>
protected void GridView2_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c = e.Row.DataItem["RGBHex"];
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml(c);
>
}
}
>
Getting these compilation errors.
>
c:\...Default.aspx.cs(1,11): error CS1518: Expected class, delegate,
enum, interface, or struct
c:\...Default.aspx.cs(6,27): error CS1001: Identifier expected
c:\...Default.aspx.cs(9,1): error CS1022: Type or namespace
definition, or end-of-file expected
>
I feel like I'm getting close but I just can't get it. Thank you for
your help.
>
TF- Hide quoted text -
>
- Show quoted text -
Mate, you have to start from the basic.
It told you that you miss a class, that is you have to define the
_Default
Remember, you said <%@. Page ... Inherits="_Default"
<!----- This is the name of your class
So, the code-behind should be like this:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
...............code here...............
}
On Mar 17, 7:26 am, "TF" <TJForw...@.gmail.comwrote:
Quote:
Originally Posted by
Very newbie question and I hope this is the right group. I have a
table on a web page which contains info about paint colors. One column
contains the hex value for the color's RGB value. I want to display
info from the table in a grid or table and use the column value from
the RGBHex column to set each row's back ground color. I can just
about do this in my sleep in old style ASP using <%%tags but I would
like to implement it in .NET 2. My website has this implemented in
old ASP here: www.paintmatcher.com/tool/tool.asp Any help is greatly
appreciated.
Got it to work now. Thank you all very much!
Set browser in PrinPreview state on page load
Hi, Can i set the clients browser programmatically to PrintPreview state (File->Print Preview) when the client clicks the button print?
I don't want to use Crystal nor Report Viewer for some reasons
regards
Thanks in advance! More Power!
Hi,
As far as I know, it's impossible because you have to manipulate IE from client. If so, that means you have access to control windows process, then that's very dangerous. What's more, in fact, there are little APIs for us to control IE's function, especially such thing.
HTH
Hey Dfox,
Unfortunately asp.net works server side, so you can't change client side behaviour.
Keep up the good programming!
Thursday, March 29, 2012
Set CheckBox or Radio in repeater with if statement
Attempting to display a questions list in my aspx page with the help of a
repeater.
This repeater displays each question (Label and picture) and each answer in
a nested repeater.
My problem is that each question can have ONE good answer or SEVERAL.
If the question has just one good answer, I want my answers displayed with
radio buttons.
In the other case, with checkbox.
is It Possible ?
Thks for help.Yes, but you'll most likely need to implement the logic in the ItemDataBound
event. This will let you define a placeholder in the itemTemplate which you
can then fill and dynamically create the checkbox/radiolist. You can find
out more at: http://www.openmymind.net/databinding/index.html
karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Mick" <saulot@.libertysurf.fr> wrote in message
news:41da537a$0$21436$636a15ce@.news.free.fr...
> Hi,
> Attempting to display a questions list in my aspx page with the help of a
> repeater.
> This repeater displays each question (Label and picture) and each answer
in
> a nested repeater.
> My problem is that each question can have ONE good answer or SEVERAL.
> If the question has just one good answer, I want my answers displayed with
> radio buttons.
> In the other case, with checkbox.
> is It Possible ?
> Thks for help.
>
>
Set CheckBox or Radio in repeater with if statement
Attempting to display a questions list in my aspx page with the help of a
repeater.
This repeater displays each question (Label and picture) and each answer in
a nested repeater.
My problem is that each question can have ONE good answer or SEVERAL.
If the question has just one good answer, I want my answers displayed with
radio buttons.
In the other case, with checkbox.
is It Possible ?
Thks for help.Yes, but you'll most likely need to implement the logic in the ItemDataBound
event. This will let you define a placeholder in the itemTemplate which you
can then fill and dynamically create the checkbox/radiolist. You can find
out more at: http://www.openmymind.net/databinding/index.html
karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Mick" <saulot@.libertysurf.fr> wrote in message
news:41da537a$0$21436$636a15ce@.news.free.fr...
> Hi,
> Attempting to display a questions list in my aspx page with the help of a
> repeater.
> This repeater displays each question (Label and picture) and each answer
in
> a nested repeater.
> My problem is that each question can have ONE good answer or SEVERAL.
> If the question has just one good answer, I want my answers displayed with
> radio buttons.
> In the other case, with checkbox.
> is It Possible ?
> Thks for help.
Set checkboxs to be checked dynamically
I retrieve checkbox ids from a querystring on a page. Now I need to set the checkboxs to be checked on that page retrieving the ids from the querystring. How do I go about it?
Need some working code please
-vjI tired this...but no luck!!!!
dim ctrl as New HtmlInputCheckBox()
cur_choiceArray = split(request.QueryString("edit_item"), "," )
for i = Lbound(cur_choiceArray) to Ubound(cur_choiceArray)
ctrl = CType(cur_choiceArray(i), HtmlInputCheckBox)
ctrl.Checked=True
next
WHat am i doing wrong here?!
hi rveejay,
you could try like this:
Dim MyControlName As String = Request.QueryString("id")
CType(Me.FindControl(MyControlName), CheckBox).Checked = True
Regards
Richard Bean
set control on masterpage
Or can you only place stuff in the contentplace holder.
f.e i want to place a label on the masterpage.
and put info in it from a contentpage created from the masterpage
thanxI don't think so and probably this violates the benefit of master pages.
Hi,
Pirate: This can be useful if you have a label on your page and want to change it to reflect what is in your content and I don't see a problem with this myself but my ears are always open to suggestions...
spoofer: You can do it like this...
In your master page define a property public string setLabel
{
set { this.lblTitle.Text = value; }
get { return this.lblTitle.Text; }
}
Then in your content page at the top of the .aspx<%@. MasterType VirtualPath="~/base.master" %>
and in your content page codebehindthis.Master.setLabel = "This is new label";
I'm just following what's called 'best practice' from MS... :p.I've not seen anyone doing it this way.It could be right but rarely used!
Thanx Fishcake, just what i was looking for!
Example + Demo
here:
http://www.geula.biz/works/sample/asp%20net/addControlFromTheContentToTheMaster.aspx
I'm just following what's called 'best practice' from MS... :p.I've not seen anyone doing it this way.It could be right but rarely used!
Not necessarily 'best', then.
There are certain dependencies that do arise in some applications, because a Master Page cannot necessarily be so static. It's also why Master Pages are actually controls that are injected into a page that 'uses' the master page.
Set Custom Page properties declaratively
I have a base class (which inherits from System.Web.UI.Page) for all the
pages in my application. I have a property defined on this class that I wan
t
to set declaratively in the .aspx (i.e., not in the .aspx.cs) file.
Is there any way to do this declaratively? When I try to use the <@dotnet.itags.org. Page
...> directive, it only allows the predefined attributes to be used.
Thanks,
Richard Brown<script language="CSharp" runat="server">
// put your code in here
</script>
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a horse to water,
but you can't make him think.
"Richard Brown" <Richard Brown@.discussions.microsoft.com> wrote in message
news:70E934C5-8E5D-40C8-ACE0-4A1D2D7587E9@.microsoft.com...
> Hi,
> I have a base class (which inherits from System.Web.UI.Page) for all the
> pages in my application. I have a property defined on this class that I
> want
> to set declaratively in the .aspx (i.e., not in the .aspx.cs) file.
> Is there any way to do this declaratively? When I try to use the <@. Page
> ...> directive, it only allows the predefined attributes to be used.
> Thanks,
> Richard Brown
>
Thanks for replying so quickly. Unfortunately the example you have provided
does not meet my requirements on two counts:
1. This is not declarative. This is code, and I would add this to the
code-behind class.
2. The <script> tags allow the client to define functions, but not run code
.
If the code requires to be run it needs the old-style <% %> breakout.
However this code is then run during the rendering of the page, which is
invoked from the .Net Framework (i.e,. the client does not have control over
when this code is executed).
I was wondering if there is a way of declaratively setting the properties of
the page class before the OnInit (in much the same way that properties are
set in a server control).
Thanks,
Richard Brown
"Kevin Spencer" wrote:
> <script language="CSharp" runat="server">
> // put your code in here
> </script>
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> You can lead a horse to water,
> but you can't make him think.
> "Richard Brown" <Richard Brown@.discussions.microsoft.com> wrote in message
> news:70E934C5-8E5D-40C8-ACE0-4A1D2D7587E9@.microsoft.com...
>
>