Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Saturday, March 31, 2012

Set a icon to a web application

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)
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

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)
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 value to a hidden field in a web page

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@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

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@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 application variable from a class

Hi
I am trying to set an application variable from a class file in my website.
Currently, the class file inherits from System.Web.UI.Page
I also referenced all the namespaces a normal webform would.
However, when i try save my application variable like such:
Application["test"] = "hello";
I get the following error:
Object reference not set to an instance of an object
How can i set an application variable from a class
It works fine from a webform
TIA
GrantGot It
HttpContext.Current.Application[ ...
"Grant Merwitz" <grant@.workshare.com> wrote in message
news:%23hZBPQ9NGHA.3984@.TK2MSFTNGP14.phx.gbl...
> Hi
> I am trying to set an application variable from a class file in my
> website.
> Currently, the class file inherits from System.Web.UI.Page
> I also referenced all the namespaces a normal webform would.
> However, when i try save my application variable like such:
> Application["test"] = "hello";
> I get the following error:
> Object reference not set to an instance of an object
> How can i set an application variable from a class
> It works fine from a webform
> TIA
> Grant
>

Set application variable from a class

Hi

I am trying to set an application variable from a class file in my website.

Currently, the class file inherits from System.Web.UI.Page
I also referenced all the namespaces a normal webform would.

However, when i try save my application variable like such:
Application["test"] = "hello";
I get the following error:
Object reference not set to an instance of an object

How can i set an application variable from a class
It works fine from a webform

TIA

GrantGot It

HttpContext.Current.Application[ ...

"Grant Merwitz" <grant@.workshare.com> wrote in message
news:%23hZBPQ9NGHA.3984@.TK2MSFTNGP14.phx.gbl...
> Hi
> I am trying to set an application variable from a class file in my
> website.
> Currently, the class file inherits from System.Web.UI.Page
> I also referenced all the namespaces a normal webform would.
> However, when i try save my application variable like such:
> Application["test"] = "hello";
> I get the following error:
> Object reference not set to an instance of an object
> How can i set an application variable from a class
> It works fine from a webform
> TIA
> Grant

Set Asp.Net web control ID

Hello,
Can someone tell me where can I find a list of the characters which I
can use in a web control ID?
Can I for example do:
MyLabel.ID = "Namespace#Control_Type"
Thanks,
Miguelshould be a legal xml id. (note: leading special chars are not allowed - ms
breaks this rule)
reg expression: [A-Za-z][A-Za-z0-9:_.-]*
if the id is used with a runat server, then it needs to be a valid .net
identifier.
-- bruce (sqlwork.com)
"shapper" <mdmoura@.gmail.com> wrote in message
news:1161701364.541401.15700@.k70g2000cwa.googlegroups.com...
> Hello,
> Can someone tell me where can I find a list of the characters which I
> can use in a web control ID?
> Can I for example do:
> MyLabel.ID = "Namespace#Control_Type"
> Thanks,
> Miguel
>

Set Asp.Net web control ID

Hello,

Can someone tell me where can I find a list of the characters which I can use in a web control ID?

Can I for example do:

MyLabel.ID = "Namespace#Control_Type"

Thanks,

Miguel

If you want to be safe, stick with letters and numbers (starting with a letter). Why would you need to worry about other characters?


System.Web.UI documentation for the Control.ID property states only this:

Including spaces in this property will cause an ASP.NET page parser error.

Just for fun, I created 256 labels, each using 1 of the ASCII characters:

for (Int32 counter = 0; counter <= 255; counter++)
{
try
{
Label lbl = new Label();
lbl.ID = "test_ " + Convert.ToChar(counter) + "test";
lbl.Text = "My ID is '" + lbl.ID + "'<br>";
Controls.Add(lbl);
}
catch
{
Label lbl = new Label();
lbl.Text = "ERROR USING CHARACTER '" + Convert.ToChar(counter) + "'<br>";
Controls.Add(lbl);
}
}

It generated no errors. So, I assume you can use any characters you want.

However, you may not use spaces if you declare the label in your HTML markup. For example, this throws an error:

<asp:Label ID="test test" runat="server" />


You, sir, have too much time on your hands. I envy you your four seasons...

Actually, that's a nice little demo, but you probably should consider a few more things. First off, I'd bet that there are other characters that the compiler doesn't like in markup (though of course I'm just assuming). Second, what happens when these controls need to be picked up on postback, or -- more likely to cause a problem -- accessed by client-side code? If nothing else, using chars like underscores, dollar signs, pound signs, and dots are going to confuse the heck out of anyone in the rendered HTML trying to tell what belongs to the control and what part is from the naming container.

Cheers,

Set Asp.Net web control ID

Hello,

Can someone tell me where can I find a list of the characters which I
can use in a web control ID?

Can I for example do:

MyLabel.ID = "Namespace#Control_Type"

Thanks,

Miguelshould be a legal xml id. (note: leading special chars are not allowed - ms
breaks this rule)

reg expression: [A-Za-z][A-Za-z0-9:_.-]*

if the id is used with a runat server, then it needs to be a valid .net
identifier.

-- bruce (sqlwork.com)

"shapper" <mdmoura@.gmail.comwrote in message
news:1161701364.541401.15700@.k70g2000cwa.googlegro ups.com...

Quote:

Originally Posted by

Hello,
>
Can someone tell me where can I find a list of the characters which I
can use in a web control ID?
>
Can I for example do:
>
MyLabel.ID = "Namespace#Control_Type"
>
Thanks,
>
Miguel
>

Set Background Color Using Column Value?

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.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?

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.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!

Thursday, March 29, 2012

Set controls to nothing when finished?

Hello,
I recently saw some example code that looked similar to the following...

...
Dim literalBr As New System.Web.UI.LiteralControl()
literalBr.Text = "<br>"
literalBr.ID = "anId"
Panel1.Controls.Add(literalBr)
literalBr = Nothing
...

Is there a reason why the literalBr control was set to nothing after adding it to the panel? Does it cause memory usage to go up if you dont set controls to nothing after creating them programmatically?The garbage collector will take care cleaning up literalBr in this case. Setting literalBr to nothing is a waste of time. SeeProgramming for Garbage Collection for more details.

Set culture for a DLL (class library) referenced from web application

I am developing a DLL (class library) for a web application of mine.

In the web.config of the web application I have set: culture="en-GB"
uiCulture="en" in order that the date format will be dd/mm/yyyy.

I also changed the regional settings to that date format.

When I am using the Now() function in the DLL I get the date format in
mm/dd/yyyy instead. Why the date format in the DLL is different? Shouldn't
it take the culture settings from the web application he is referenced from?

How can I control the date format of the DLL (class library)?

Thanks for your time

ra294@dotnet.itags.org.hotmail.comYa Ya,

See this article on settig culture.

http://www.dotnetjunkies.com/Tutori...33D2EDD38B.dcik

I don't believe you are setting the culture on the thread and the
application assumes the culture of the server.

HTH MikeL.

"Ya Ya" wrote:

> I am developing a DLL (class library) for a web application of mine.
> In the web.config of the web application I have set: culture="en-GB"
> uiCulture="en" in order that the date format will be dd/mm/yyyy.
> I also changed the regional settings to that date format.
> When I am using the Now() function in the DLL I get the date format in
> mm/dd/yyyy instead. Why the date format in the DLL is different? Shouldn't
> it take the culture settings from the web application he is referenced from?
> How can I control the date format of the DLL (class library)?
>
> Thanks for your time
> ra294@.hotmail.com
>

Set Culture in Web.config

How can I set the current web culture (CultureInfo) in the
web.config?
Apogeesee the <globalization> tag
"Apogee" <developer@.biteish.net> wrote in message
news:OV6o43JTEHA.1244@.TK2MSFTNGP10.phx.gbl...
> How can I set the current web culture (CultureInfo) in the
> web.config?
> Apogee
>

Set Culture in Web.config

How can I set the current web culture (CultureInfo) in the
web.config?

Apogeesee the <globalization> tag

"Apogee" <developer@.biteish.net> wrote in message
news:OV6o43JTEHA.1244@.TK2MSFTNGP10.phx.gbl...
> How can I set the current web culture (CultureInfo) in the
> web.config?
> Apogee

Set Custom Page properties declaratively

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 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...
>
>

Wednesday, March 28, 2012

Set default framework version for a web site via the command line

Greetings,
How do I set the default version of the .net framework via the command line?
I have installed the .net framework v2 beta 2 and for what ever reason I am
unable to set the default runtime for a web site using IIS. I have used
aspnet_regiis to see if it installed properly and it has.
I want to use the command line to get around this issue. I've googled it and
still nothing.
Thanks,
BryanUse the application's ASP.NET tab in the IIS Manager,
or use Denis Bauer's ASP.NET Version Switcher :
http://www.denisbauer.com/NETTools/...onSwitcher.aspx
Juan T. Llibre
ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
==========================
"RedEye" <redeye_51@.hotmail.com> wrote in message
news:OhV8hzzsFHA.2540@.TK2MSFTNGP09.phx.gbl...
> Greetings,
> How do I set the default version of the .net framework via the command lin
e?
> I have installed the .net framework v2 beta 2 and for what ever reason I a
m unable to
> set the default runtime for a web site using IIS. I have used aspnet_regii
s to see if it
> installed properly and it has.
> I want to use the command line to get around this issue. I've googled it a
nd still
> nothing.
> Thanks,
> Bryan
>
I forgot about that tool.
THANKS!!!
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uSyuc9zsFHA.904@.tk2msftngp13.phx.gbl...
> Use the application's ASP.NET tab in the IIS Manager,
> or use Denis Bauer's ASP.NET Version Switcher :
> http://www.denisbauer.com/NETTools/...onSwitcher.aspx
>
> Juan T. Llibre
> ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ==========================
> "RedEye" <redeye_51@.hotmail.com> wrote in message
> news:OhV8hzzsFHA.2540@.TK2MSFTNGP09.phx.gbl...
>

Set default framework version for a web site via the command line

Greetings,

How do I set the default version of the .net framework via the command line?

I have installed the .net framework v2 beta 2 and for what ever reason I am
unable to set the default runtime for a web site using IIS. I have used
aspnet_regiis to see if it installed properly and it has.

I want to use the command line to get around this issue. I've googled it and
still nothing.

Thanks,
BryanUse the application's ASP.NET tab in the IIS Manager,
or use Denis Bauer's ASP.NET Version Switcher :

http://www.denisbauer.com/NETTools/...onSwitcher.aspx

Juan T. Llibre
ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
==========================

"RedEye" <redeye_51@.hotmail.com> wrote in message
news:OhV8hzzsFHA.2540@.TK2MSFTNGP09.phx.gbl...
> Greetings,
> How do I set the default version of the .net framework via the command line?
> I have installed the .net framework v2 beta 2 and for what ever reason I am unable to
> set the default runtime for a web site using IIS. I have used aspnet_regiis to see if it
> installed properly and it has.
> I want to use the command line to get around this issue. I've googled it and still
> nothing.
> Thanks,
> Bryan
I forgot about that tool.

THANKS!!!

"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uSyuc9zsFHA.904@.tk2msftngp13.phx.gbl...
> Use the application's ASP.NET tab in the IIS Manager,
> or use Denis Bauer's ASP.NET Version Switcher :
> http://www.denisbauer.com/NETTools/...onSwitcher.aspx
>
> Juan T. Llibre
> ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ==========================
> "RedEye" <redeye_51@.hotmail.com> wrote in message
> news:OhV8hzzsFHA.2540@.TK2MSFTNGP09.phx.gbl...
>> Greetings,
>>
>> How do I set the default version of the .net framework via the command
>> line?
>>
>> I have installed the .net framework v2 beta 2 and for what ever reason I
>> am unable to set the default runtime for a web site using IIS. I have
>> used aspnet_regiis to see if it installed properly and it has.
>>
>> I want to use the command line to get around this issue. I've googled it
>> and still nothing.
>>
>> Thanks,
>> Bryan
>>

Monday, March 26, 2012

Set default Tag Prefix and CSS?

Hello,
I am creating a web server control derived from
datagrid for the first time. Now I would like to set the
prefix of my control by default to SK instead of CC1. Is
that possible? The other question is that my datagrid
should use a default stylesheet. I have set the cssclass
property of all items which I want to change. BUT I am not
setting the link tag in the head section to my css. I dont
want to do that. I would like to do that direclty in my
component. Is that possible?
ThanksAlternatingItemStyle
ItemStyle
HeaderStyle
footerstyle
if u set css for these four element, css will apply for u're componet. plz
see blow , I explained how we hve to use sample class...
<asp:datagrid id="dgActivity" runat="server" AllowPaging="True"
Class="DataGridStyle" Width="100%"
CellPadding="2" PageSize="30" AutoGenerateColumns="False" AllowSorting="True
">
<AlternatingItemStyle
CssClass="DataGridAlterItemStyle"></AlternatingItemStyle>
<ItemStyle CssClass="DataGridItemStyle"></ItemStyle>
<HeaderStyle CssClass="DataGridHeaderStyle"></HeaderStyle>
.DataGridStyle
{
border-color : White;
border-style : solid;
}
.DataGridStyle td
{
border-color : White;
border-style : solid;
}
.DataGridHeaderStyle
{
font-size : 8pt;
font-family : Verdana;
font-weight : bold;
vertical-align : middle;
text-align : center;
color:White;
text-align : left;
background-color : "#6487DC";
}
.DataGridHeaderStyle a
{
font-size : 8pt;
font-family : Verdana;
font-weight : bold;
vertical-align : middle;
text-align : center;
color:White;
text-align : left;
background-color : "#6487DC";
}
.DataGridHeaderStyle a:link
{
font-size : 8pt;
font-family : Verdana;
font-weight : bold;
vertical-align : middle;
text-align : center;
color:White;
text-align : left;
background-color : "#6487DC";
}
.DataGridHeaderStyle a:hover
{
font-size : 8pt;
font-family : Verdana;
font-weight : bold;
vertical-align : middle;
text-align : center;
color:White;
text-align : left;
background-color : "#6487DC";
}
.DataGridHeaderStyle a:visited
{
font-size : 8pt;
font-family : Verdana;
font-weight : bold;
vertical-align : middle;
text-align : center;
color:White;
text-align : left;
background-color : "#6487DC";
}
"SK" wrote:

> Hello,
> I am creating a web server control derived from
> datagrid for the first time. Now I would like to set the
> prefix of my control by default to SK instead of CC1. Is
> that possible? The other question is that my datagrid
> should use a default stylesheet. I have set the cssclass
> property of all items which I want to change. BUT I am not
> setting the link tag in the head section to my css. I dont
> want to do that. I would like to do that direclty in my
> component. Is that possible?
> Thanks
>
Hello SK,
Look at the [assembly:TagPrefix] attribute. You'll need to reference System.Web.UI,
if you're not already.
[assembly:TagPrefix("YourNamespace", "YourPrefix")]
Matt Berther
http://www.mattberther.com

> Hello,
> I am creating a web server control derived from datagrid for the
> first time. Now I would like to set the prefix of my control by
> default to SK instead of CC1. Is that possible? The other question is
> that my datagrid should use a default stylesheet. I have set the
> cssclass property of all items which I want to change. BUT I am not
> setting the link tag in the head section to my css. I dont want to do
> that. I would like to do that direclty in my component. Is that
> possible?
> Thanks
>

Set default Tag Prefix and CSS?

Hello,

I am creating a web server control derived from
datagrid for the first time. Now I would like to set the
prefix of my control by default to SK instead of CC1. Is
that possible? The other question is that my datagrid
should use a default stylesheet. I have set the cssclass
property of all items which I want to change. BUT I am not
setting the link tag in the head section to my css. I dont
want to do that. I would like to do that direclty in my
component. Is that possible?

ThanksAlternatingItemStyle
ItemStyle
HeaderStyle
footerstyle

if u set css for these four element, css will apply for u're componet. plz
see blow , I explained how we hve to use sample class...
<asp:datagrid id="dgActivity" runat="server" AllowPaging="True"
Class="DataGridStyle" Width="100%"
CellPadding="2" PageSize="30" AutoGenerateColumns="False" AllowSorting="True">
<AlternatingItemStyle
CssClass="DataGridAlterItemStyle"></AlternatingItemStyle>
<ItemStyle CssClass="DataGridItemStyle"></ItemStyle>
<HeaderStyle CssClass="DataGridHeaderStyle"></HeaderStyle
..DataGridStyle
{
border-color : White;
border-style : solid;
}
..DataGridStyle td
{
border-color : White;
border-style : solid;
}
..DataGridHeaderStyle
{
font-size : 8pt;
font-family : Verdana;
font-weight : bold;
vertical-align : middle;
text-align : center;
color:White;
text-align : left;
background-color : "#6487DC";

}
..DataGridHeaderStyle a
{
font-size : 8pt;
font-family : Verdana;
font-weight : bold;
vertical-align : middle;
text-align : center;
color:White;
text-align : left;
background-color : "#6487DC";
}
..DataGridHeaderStyle a:link
{
font-size : 8pt;
font-family : Verdana;
font-weight : bold;
vertical-align : middle;
text-align : center;
color:White;
text-align : left;
background-color : "#6487DC";
}
..DataGridHeaderStyle a:hover
{
font-size : 8pt;
font-family : Verdana;
font-weight : bold;
vertical-align : middle;
text-align : center;
color:White;
text-align : left;
background-color : "#6487DC";
}
..DataGridHeaderStyle a:visited
{
font-size : 8pt;
font-family : Verdana;
font-weight : bold;
vertical-align : middle;
text-align : center;
color:White;
text-align : left;
background-color : "#6487DC";
}

"SK" wrote:

> Hello,
> I am creating a web server control derived from
> datagrid for the first time. Now I would like to set the
> prefix of my control by default to SK instead of CC1. Is
> that possible? The other question is that my datagrid
> should use a default stylesheet. I have set the cssclass
> property of all items which I want to change. BUT I am not
> setting the link tag in the head section to my css. I dont
> want to do that. I would like to do that direclty in my
> component. Is that possible?
> Thanks
Hello SK,

Look at the [assembly:TagPrefix] attribute. You'll need to reference System.Web.UI,
if you're not already.

[assembly:TagPrefix("YourNamespace", "YourPrefix")]

--
Matt Berther
http://www.mattberther.com

> Hello,
> I am creating a web server control derived from datagrid for the
> first time. Now I would like to set the prefix of my control by
> default to SK instead of CC1. Is that possible? The other question is
> that my datagrid should use a default stylesheet. I have set the
> cssclass property of all items which I want to change. BUT I am not
> setting the link tag in the head section to my css. I dont want to do
> that. I would like to do that direclty in my component. Is that
> possible?
> Thanks