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

Thursday, March 29, 2012

newbie: Help, I have problems with this!

hey
asp.net 2.0
visual web developer 2005 express
I have a webpage which contains 1 Repeater control. Into this repeater
control I want to add several rows of data. My problem is that 1 of the data
is an array of bytes (it's a picture saved to the database as bytes) and I
want that picture to be displayed nicely in the repeater list...
Here is two approaches (approach A and approach B) I'm trying:
APPROACH A:
Use the scenario of 2 .aspx files, 1 .aspx (A) convert the bytes of array
into a picture and the other .aspx file (B) has a img tag pointing to the
first .aspx file (A)
But here I get problems with this line "img.Src =
"Thumnail.aspx?ImageID=1";", it looks like it expects a object... Somehow I
need to send over a parameter to this Thumbnail.aspx file about which image
to display... Lets say the resultset has many images, but this row shall
display one particular image
protected void rptInbox_ItemDataBound(object sender, RepeaterItemEventArgs
e)
{
System.Web.UI.HtmlControls.HtmlImage img = null;
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType ==
ListItemType.AlternatingItem)) {
img =
(System.Web.UI.HtmlControls.HtmlImage)e.Item.FindControl("Photo");
img.Src = "Thumnail.aspx?ImageID=1";
}
}
<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="inbox.aspx.cs"
Inherits="webForms_Profile_inbox" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="content" Runat="Server">
<asp:ObjectDataSource ID="odsInbox" runat="server"
SelectMethod="getInbox" TypeName="BusinessLogic.NetworkLogic">
</asp:ObjectDataSource>
<asp:Repeater ID="rptInbox" runat="server" DataSourceID="odsInbox"
OnItemDataBound="rptInbox_ItemDataBound">
<ItemTemplate>
<tr>
<td bgcolor="#CCFFCC">
<%# Eval("Name") %>
<img ID="Photo" src="http://pics.10026.com/?src=" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="sidebar" Runat="Server">
</asp:Content>
****************************************
************************
APPROACH B:
In this approach I tryed to replace the img tag with a Image control in the
repeater.
But the "System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(mstream);"
gives this error:
"Parameter is not valid."
Another thing is that I'm not sure this is a good approach because it uses
bmp.Save() and I'm afraid the server will run out of space if images get
saved on the server each time th page is displayed?
protected void rptInbox_ItemDataBound(object sender, RepeaterItemEventArgs
e)
{
//System.Web.UI.HtmlControls.HtmlImage img = null;
System.Web.UI.WebControls.Image img = null;
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType ==
ListItemType.AlternatingItem)) {
img =
(System.Web.UI.WebControls.Image)e.Item.FindControl("Photo");
byte[] data = Profile.Picture;
Int32 offset = 78;
System.IO.MemoryStream mstream = new System.IO.MemoryStream();
mstream.Write(data, offset, data.Length - offset);
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(mstream);
bmp.Save(Server.MapPath("sample.jpeg"),
System.Drawing.Imaging.ImageFormat.Jpeg);
mstream.Close();
img.ImageUrl = Server.MapPath("sample.jpeg");
}
//e.Item.DataItem.ToString();
}
Please help me with this one, I'm stucked in this problem...
Best Regards
Jeffhi Jeff
I think I've covered this in a previous thread, but anyways
on this page is an example of dynamically displaying binary image data
on a Web page. this uses a GridView but the logic's the same
http://authors.aspalliance.com/aspx...classbinarywri=
te.aspx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
Reynald V. Nu=F1ez
http://authors.aspalliance.com/aspxtreme

newbie: Help, I have problems with this!

hey

asp.net 2.0
visual web developer 2005 express

I have a webpage which contains 1 Repeater control. Into this repeater
control I want to add several rows of data. My problem is that 1 of the data
is an array of bytes (it's a picture saved to the database as bytes) and I
want that picture to be displayed nicely in the repeater list...

Here is two approaches (approach A and approach B) I'm trying:

APPROACH A:
Use the scenario of 2 .aspx files, 1 .aspx (A) convert the bytes of array
into a picture and the other .aspx file (B) has a img tag pointing to the
first .aspx file (A)

But here I get problems with this line "img.Src =
"Thumnail.aspx?ImageID=1";", it looks like it expects a object... Somehow I
need to send over a parameter to this Thumbnail.aspx file about which image
to display... Lets say the resultset has many images, but this row shall
display one particular image

protected void rptInbox_ItemDataBound(object sender, RepeaterItemEventArgs
e)
{
System.Web.UI.HtmlControls.HtmlImage img = null;
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType ==
ListItemType.AlternatingItem)) {
img =
(System.Web.UI.HtmlControls.HtmlImage)e.Item.FindC ontrol("Photo");
img.Src = "Thumnail.aspx?ImageID=1";
}
}

<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="inbox.aspx.cs"
Inherits="webForms_Profile_inbox" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="content" Runat="Server">
<asp:ObjectDataSource ID="odsInbox" runat="server"
SelectMethod="getInbox" TypeName="BusinessLogic.NetworkLogic">
</asp:ObjectDataSource>
<asp:Repeater ID="rptInbox" runat="server" DataSourceID="odsInbox"
OnItemDataBound="rptInbox_ItemDataBound">
<ItemTemplate>
<tr>
<td bgcolor="#CCFFCC">
<%# Eval("Name") %>
<img ID="Photo" src="http://pics.10026.com/?src=" />
</td>
</tr>
</ItemTemplate>

</asp:Repeater>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="sidebar" Runat="Server">
</asp:Content>

************************************************** **************
APPROACH B:

In this approach I tryed to replace the img tag with a Image control in the
repeater.
But the "System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(mstream);"
gives this error:
"Parameter is not valid."

Another thing is that I'm not sure this is a good approach because it uses
bmp.Save() and I'm afraid the server will run out of space if images get
saved on the server each time th page is displayed?

protected void rptInbox_ItemDataBound(object sender, RepeaterItemEventArgs
e)
{
//System.Web.UI.HtmlControls.HtmlImage img = null;
System.Web.UI.WebControls.Image img = null;

if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType ==
ListItemType.AlternatingItem)) {
img =
(System.Web.UI.WebControls.Image)e.Item.FindContro l("Photo");
byte[] data = Profile.Picture;

Int32 offset = 78;
System.IO.MemoryStream mstream = new System.IO.MemoryStream();
mstream.Write(data, offset, data.Length - offset);
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(mstream);

bmp.Save(Server.MapPath("sample.jpeg"),
System.Drawing.Imaging.ImageFormat.Jpeg);
mstream.Close();
img.ImageUrl = Server.MapPath("sample.jpeg");

}

//e.Item.DataItem.ToString();
}

Please help me with this one, I'm stucked in this problem...

Best Regards

Jeffhi Jeff

I think I've covered this in a previous thread, but anyways

on this page is an example of dynamically displaying binary image data
on a Web page. this uses a GridView but the logic's the same

http://authors.aspalliance.com/aspx...inarywrite.aspx
==============================
Reynald V. Nuez
http://authors.aspalliance.com/aspxtreme

Newbie: How do I create Dynamic instrument widgets in ASP.NET

Hello,
I want to create a dynamic web page, which presents various instrument
widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
browser, with continous data updates from Server side data. Obviously
these instruments need to be constantly refreshed (every 0.5 second or
so) and not just on page load.
With Windows Forms, and GDI I can do this with networked Thick Client
code. I can also do dynamic web instruments with Java Applets, and I
guess DHTML/Javascript. But I really want to do the instruments in C#
and .NET. But I don't think that I can achieve this, because http and
ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
upon Server side controls, that won't refresh my instruments with live
data, once the page is downloaded. (Traditional DHTML/Javascript looks
like a real pain to develop instruments in.)
I am agreat fan of .NET technologies, but I was hoping for better MS
and .NET support for these instrument based web applications. But I
guess my only real choice is Java Applets !
Any suggestions on how I can achieve dynamic web instruments with .NET
technology would be appreciated.
Thanks
JulesThere may well be other ways of acheiving this kind of thing, but you could
just refresh the image (in JS) representing the clock
or you could use the WebBehaviour stuff, this will allow you to connect to a
webservice on the server (using JS again) then you can update your clock or
gauge or whatever in the JS on the client.
"Jules" <Roseanna80@.hotmail.com> wrote in message
news:80bc211e.0503310335.15a8c492@.posting.google.com...
> Hello,
> I want to create a dynamic web page, which presents various instrument
> widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
> browser, with continous data updates from Server side data. Obviously
> these instruments need to be constantly refreshed (every 0.5 second or
> so) and not just on page load.
> With Windows Forms, and GDI I can do this with networked Thick Client
> code. I can also do dynamic web instruments with Java Applets, and I
> guess DHTML/Javascript. But I really want to do the instruments in C#
> and .NET. But I don't think that I can achieve this, because http and
> ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
> upon Server side controls, that won't refresh my instruments with live
> data, once the page is downloaded. (Traditional DHTML/Javascript looks
> like a real pain to develop instruments in.)
> I am agreat fan of .NET technologies, but I was hoping for better MS
> and .NET support for these instrument based web applications. But I
> guess my only real choice is Java Applets !
> Any suggestions on how I can achieve dynamic web instruments with .NET
> technology would be appreciated.
> Thanks
> Jules
I'd say your requirements don't lend themselves to building a browser based
application. Consider building a traditional fat client app using ClickOnce
or NoTouch Deployment. A java applet is really no different.
-Brock
DevelopMentor
http://staff.develop.com/ballen

> Hello,
> I want to create a dynamic web page, which presents various instrument
> widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
> browser, with continous data updates from Server side data. Obviously
> these instruments need to be constantly refreshed (every 0.5 second or
> so) and not just on page load.
> With Windows Forms, and GDI I can do this with networked Thick Client
> code. I can also do dynamic web instruments with Java Applets, and I
> guess DHTML/Javascript. But I really want to do the instruments in C#
> and .NET. But I don't think that I can achieve this, because http and
> ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
> upon Server side controls, that won't refresh my instruments with live
> data, once the page is downloaded. (Traditional DHTML/Javascript looks
> like a real pain to develop instruments in.)
> I am agreat fan of .NET technologies, but I was hoping for better MS
> and .NET support for these instrument based web applications. But I
> guess my only real choice is Java Applets !
> Any suggestions on how I can achieve dynamic web instruments with .NET
> technology would be appreciated.
> Thanks
> Jules
>

Newbie: How do I create Dynamic instrument widgets in ASP.NET

Hello,

I want to create a dynamic web page, which presents various instrument
widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
browser, with continous data updates from Server side data. Obviously
these instruments need to be constantly refreshed (every 0.5 second or
so) and not just on page load.

With Windows Forms, and GDI I can do this with networked Thick Client
code. I can also do dynamic web instruments with Java Applets, and I
guess DHTML/Javascript. But I really want to do the instruments in C#
and .NET. But I don't think that I can achieve this, because http and
ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
upon Server side controls, that won't refresh my instruments with live
data, once the page is downloaded. (Traditional DHTML/Javascript looks
like a real pain to develop instruments in.)

I am agreat fan of .NET technologies, but I was hoping for better MS
and .NET support for these instrument based web applications. But I
guess my only real choice is Java Applets !

Any suggestions on how I can achieve dynamic web instruments with .NET
technology would be appreciated.

Thanks

JulesThere may well be other ways of acheiving this kind of thing, but you could
just refresh the image (in JS) representing the clock

or you could use the WebBehaviour stuff, this will allow you to connect to a
webservice on the server (using JS again) then you can update your clock or
gauge or whatever in the JS on the client.

"Jules" <Roseanna80@.hotmail.com> wrote in message
news:80bc211e.0503310335.15a8c492@.posting.google.c om...
> Hello,
> I want to create a dynamic web page, which presents various instrument
> widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
> browser, with continous data updates from Server side data. Obviously
> these instruments need to be constantly refreshed (every 0.5 second or
> so) and not just on page load.
> With Windows Forms, and GDI I can do this with networked Thick Client
> code. I can also do dynamic web instruments with Java Applets, and I
> guess DHTML/Javascript. But I really want to do the instruments in C#
> and .NET. But I don't think that I can achieve this, because http and
> ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
> upon Server side controls, that won't refresh my instruments with live
> data, once the page is downloaded. (Traditional DHTML/Javascript looks
> like a real pain to develop instruments in.)
> I am agreat fan of .NET technologies, but I was hoping for better MS
> and .NET support for these instrument based web applications. But I
> guess my only real choice is Java Applets !
> Any suggestions on how I can achieve dynamic web instruments with .NET
> technology would be appreciated.
> Thanks
> Jules
I'd say your requirements don't lend themselves to building a browser based
application. Consider building a traditional fat client app using ClickOnce
or NoTouch Deployment. A java applet is really no different.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> Hello,
> I want to create a dynamic web page, which presents various instrument
> widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
> browser, with continous data updates from Server side data. Obviously
> these instruments need to be constantly refreshed (every 0.5 second or
> so) and not just on page load.
> With Windows Forms, and GDI I can do this with networked Thick Client
> code. I can also do dynamic web instruments with Java Applets, and I
> guess DHTML/Javascript. But I really want to do the instruments in C#
> and .NET. But I don't think that I can achieve this, because http and
> ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
> upon Server side controls, that won't refresh my instruments with live
> data, once the page is downloaded. (Traditional DHTML/Javascript looks
> like a real pain to develop instruments in.)
> I am agreat fan of .NET technologies, but I was hoping for better MS
> and .NET support for these instrument based web applications. But I
> guess my only real choice is Java Applets !
> Any suggestions on how I can achieve dynamic web instruments with .NET
> technology would be appreciated.
> Thanks
> Jules

Newbie: How safe is source code?

Hi

I am a complete newbie and am contemplating moving to asp.net from asp. How
protected is an asp.net web site source code should it be delivered to a
client?

Thanks

RegardsMy opinion:

If your concern is about protecting access to the code itself, then ASP.NET
source is much safer than classic ASP, because the deliverable is actually a
set of compiled .dll's, rather than a set of vbscript files.

However, you should be aware that it is notoriously easy to decompile a .NET
assembly into very clean source code. If this worries you, you should
consider using an obfuscator to "scramble" the dll code so that decompiling
either doesn't work or doesn't work very well.

-Michael

"John" <john@.nospam.infovis.co.uk> wrote in message
news:Oo1BKKIpDHA.2732@.TK2MSFTNGP11.phx.gbl...
> Hi
> I am a complete newbie and am contemplating moving to asp.net from asp.
How
> protected is an asp.net web site source code should it be delivered to a
> client?
> Thanks
> Regards
Hi John,

You should obfuscate your ASP.NET with Dotfuscator (a .NET
obfuscator).
A lite version is included inside VS.NET 2003 under the tools menu.
This will make reverse engineered code harder to understand.

If you want more protection that significantly hinders reverse
engineering by crashing or stopping decompilers and support look at
Dotfuscator Professional Edition.

For more info: www.preemptive.com/dotfuscator

Best Regards,
Dotfuscator Team

> "John" <john@.nospam.infovis.co.uk>
> > Hi
> > I am a complete newbie and am contemplating moving to asp.net from asp.
> How
> > protected is an asp.net web site source code should it be delivered to a
> > client?
I agree. But what about 'Whidbey' (new VS 2004)? I think we going
back to no code-behind'.

-----------------------
http://www.naptaxes.com/AAJ/
[AllAmericanJobs - Searching jobs from your desktop and automatically
sends resume.]
Even with 'no code behind' isn't the result still .NET code which can be decompiled?

> I agree. But what about 'Whidbey' (new VS 2004)? I think we going
> back to ?no code-behind'.

Newbie: How to display search results?

I am new to ASP.NET, so probably my question is very basic:

I have a web page (page1) where I allow the user to make a search, text box
plus a botton (botton1).
When he click the botton (button1), the server obtain (from memory) an array
of Products Id.
I want to open a second web page (page 2) with the results (obtained from a
database using the Products Id), the results will be shown in a datagrid.

My question:
- If Once I clicked botton1 I retrieve from de database the Products (using
the array of ProductsId and a datareader) how I bound this datareader to the
datagrid in page2?.
- I think there is a second option: I pass the array (memory array) of
products Id to Page2 (how i do it?) and the Onload event of Page2 read the
data from the database and show it in the datagrid. How I pass the memory
array to Onload event of Page2?.

I am pretty new to ASP.NET so I suspect there is an standard way of doing
this, I welcome any suggestion.

Thanks,

JaimeI am new to ASP.NET, so probably my question is very basic:

Quote:

Originally Posted by

>
I have a web page (page1) where I allow the user to make a search, text box
plus a botton (botton1).
When he click the botton (button1), the server obtain (from memory) an array
of Products Id.
I want to open a second web page (page 2) with the results (obtained from a
database using the Products Id), the results will be shown in a datagrid.
>


By "open a second page", do you mean "open in a new window", or just
"replace the current page"? If new window, then see if there is a
"target" attribute on that button (button1). If current page, then
nothing special needs to be done.

Quote:

Originally Posted by

My question:
- If Once I clicked botton1 I retrieve from de database the Products (using
the array of ProductsId and a datareader) how I bound this datareader to the
datagrid in page2?.
- I think there is a second option: I pass the array (memory array) of
products Id to Page2 (how i do it?) and the Onload event of Page2 read the
data from the database and show it in the datagrid. How I pass the memory
array to Onload event of Page2?.
>
I am pretty new to ASP.NET so I suspect there is an standard way of doing
this, I welcome any suggestion.
>
Thanks,
>
Jaime


To switch from one page to another, you can use "Response.Redirect()",
using the new url as a parameter.

To pass data from one page to another, there are several options:
- querystring, like "page2.aspx?searchtext=bla". Best for a small list
of short values, that can be represented by a string.
- Session data. In page1 you store "it" in the session
(Session["productids"] = list) and in page2 you read it, casting as
required ( int[] list = (int[])Session["productids"] )

You can perform the search in page1, passing the results (via Session)
to page2. Or you can pass the searchtext to page2 (session or
querystring), where the complete search is performed. I like the second
option better, as you concentrate the "search functionality" in that
page.

Hans Kesting

Newbie: How to upload and save images using ASP.NET web forms (C#)

Hello -

I need to upload images in my web application using ASP.NET web forms
(written in C#). Since i have never done this before, i am unsure what is the
best method.

I assume there are two options:

1). Upload the images and save the files directory to the windows file
system. However, i assume this poses a security risk, as the file directory
will require write permissions.

2). Save the images (as objects?) in the SQL SERVER database.

Can anyone suggest the best way to do this? And, if possible, point me to
some sample code or artciles which explain how to do this.

Thanks!Charlie,

check out the following article:

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

I prefer to save files in the database but it depends on your needs.

If you need to save hundred thousands of files and decide that you want to
save them on your hard disk make sure to distribute them on different
directories. What you could do is that you assign a guid to each file and
create your directory structure accordingly.

Example:

You have five files with the following guids

0A59E8D6-0AE5-475B-8698-814C2C712029

F16CE1B1-56D0-42E6-9463-A58D553CC289

D90C27C7 -8BD9-4F47-8CFE-DE9D240AD136

370B6080-DF06-4DDE-BB5E-85264B8AE48B

861DC387-FDC7-4A4F-B0C3-9EA6734A562A

You could now create a directory like the following:

0A59E8D6\0AE5\475B\8698\814C2C712029

F16CE1B1\56D0\42E6\9463\A58D553CC289

D90C27C7 \8BD9\4F47\8CFE\DE9D240AD136

370B6080\DF06\4DDE\BB5E\85264B8AE48B

861DC387\FDC7\4A4F\B0C3\9EA6734A562A

HTHs

Daniel

"charliewest" <charliewest@.discussions.microsoft.com> schrieb im Newsbeitrag
news:E6DD7087-DC4F-4E78-9741-0EF7F76883B6@.microsoft.com...
> Hello -
> I need to upload images in my web application using ASP.NET web forms
> (written in C#). Since i have never done this before, i am unsure what is
> the
> best method.
> I assume there are two options:
> 1). Upload the images and save the files directory to the windows file
> system. However, i assume this poses a security risk, as the file
> directory
> will require write permissions.
> 2). Save the images (as objects?) in the SQL SERVER database.
> Can anyone suggest the best way to do this? And, if possible, point me to
> some sample code or artciles which explain how to do this.
> Thanks!

newbie: HTML controls vs Web controls

Hello,
I am learning .NET 2.0. And I have a question: when to use web-controls and
when to use HTML controls?
/RAM/Hi,
R.A.M. wrote:
> Hello,
> I am learning .NET 2.0. And I have a question: when to use web-controls an
d
> when to use HTML controls?
> /RAM/
The System.Web.UI.HtmlControls namespace is for HTML controls, in the
sense that they are declared on the page using standard HTML tags, for
example "input", "select", "textarea", etc...
The System.Web.UI.WebControls namespace is for ASP.NET controls, which
are declared on the page with an "asp:" prefix, for example "asp:Checkbox".
The different is that in the first case, they're client-side controls.
You use them on the server in order to set attributes, scripts, etc...
which are executed on the client. In the second case, however, (and
while you can also influence the way they will be rendered on the
client), the events you wire them to are executed on the server
(involving a postback).
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
It depends on what you are more comfortable with. If you come from Windows
application background, you will find that web controls are more friendly
and they are a less dramatic change from your previous experience.. If you
come from html background you will like html controls. As you master your
asp.net skills, you will likely lean more towards html controls as they give
you better control over client-side functionality.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"R.A.M." <r_ahimsa_m@.poczta.onet.pl> wrote in message
news:ejgq05$8h1$1@.news.onet.pl...
> Hello,
> I am learning .NET 2.0. And I have a question: when to use web-controls
> and when to use HTML controls?
> /RAM/
>

newbie: HTML controls vs Web controls

Hello,
I am learning .NET 2.0. And I have a question: when to use web-controls and
when to use HTML controls?
/RAM/Hi,

R.A.M. wrote:

Quote:

Originally Posted by

Hello,
I am learning .NET 2.0. And I have a question: when to use web-controls and
when to use HTML controls?
/RAM/


The System.Web.UI.HtmlControls namespace is for HTML controls, in the
sense that they are declared on the page using standard HTML tags, for
example "input", "select", "textarea", etc...

The System.Web.UI.WebControls namespace is for ASP.NET controls, which
are declared on the page with an "asp:" prefix, for example "asp:Checkbox".

The different is that in the first case, they're client-side controls.
You use them on the server in order to set attributes, scripts, etc...
which are executed on the client. In the second case, however, (and
while you can also influence the way they will be rendered on the
client), the events you wire them to are executed on the server
(involving a postback).

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
It depends on what you are more comfortable with. If you come from Windows
application background, you will find that web controls are more friendly
and they are a less dramatic change from your previous experience.. If you
come from html background you will like html controls. As you master your
asp.net skills, you will likely lean more towards html controls as they give
you better control over client-side functionality.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"R.A.M." <r_ahimsa_m@.poczta.onet.plwrote in message
news:ejgq05$8h1$1@.news.onet.pl...

Quote:

Originally Posted by

Hello,
I am learning .NET 2.0. And I have a question: when to use web-controls
and when to use HTML controls?
/RAM/
>

newbie: I wonder if this is possible in asp.net 2.0

Hey

asp.net 2.0

As far as I know it's possible to search the users registrered at a asp.net
2.0 web portal using either username or e-mail.

But what about the custom profile properties which can be configured in
web.config? Can they be searched too? I guess it can by using foreach loop
and test the contents on every user object.. but I thought maybe there was a
cleaner and faster way to do it...

Lets say for example these are custom profile settings in web.config. any
suggestion on how to search them? Lets say the search should return all
users containing the phrase "Lets" in lastname? or all users of a specific
gender?
<profile enabled="true">
<properties>
<add name="FirstName" type="string"/>
<add name="LastName" type="string"/>
<add name="Gender" type="string"/>
<add name="BirthDate" type="DateTime"/>
</properties>
</profile>

Best RegardsThis article should help, and even fleshes out some of the sample code
provided by one of the MS people for it:

http://www.eggheadcafe.com/articles/20060731.asp
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Jeff" wrote:

Quote:

Originally Posted by

Hey
>
asp.net 2.0
>
As far as I know it's possible to search the users registrered at a asp.net
2.0 web portal using either username or e-mail.
>
But what about the custom profile properties which can be configured in
web.config? Can they be searched too? I guess it can by using foreach loop
and test the contents on every user object.. but I thought maybe there was a
cleaner and faster way to do it...
>
Lets say for example these are custom profile settings in web.config. any
suggestion on how to search them? Lets say the search should return all
users containing the phrase "Lets" in lastname? or all users of a specific
gender?
<profile enabled="true">
<properties>
<add name="FirstName" type="string"/>
<add name="LastName" type="string"/>
<add name="Gender" type="string"/>
<add name="BirthDate" type="DateTime"/>
</properties>
</profile>
>
Best Regards
>
>
>

newbie: I wonder if this is possible in asp.net 2.0

Hey
asp.net 2.0
As far as I know it's possible to search the users registrered at a asp.net
2.0 web portal using either username or e-mail.
But what about the custom profile properties which can be configured in
web.config? Can they be searched too? I guess it can by using foreach loop
and test the contents on every user object.. but I thought maybe there was a
cleaner and faster way to do it...
Lets say for example these are custom profile settings in web.config. any
suggestion on how to search them? Lets say the search should return all
users containing the phrase "Lets" in lastname? or all users of a specific
gender?
<profile enabled="true">
<properties>
<add name="FirstName" type="string"/>
<add name="LastName" type="string"/>
<add name="Gender" type="string"/>
<add name="BirthDate" type="DateTime"/>
</properties>
</profile>
Best RegardsThis article should help, and even fleshes out some of the sample code
provided by one of the MS people for it:
http://www.eggheadcafe.com/articles/20060731.asp
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Jeff" wrote:

> Hey
> asp.net 2.0
> As far as I know it's possible to search the users registrered at a asp.ne
t
> 2.0 web portal using either username or e-mail.
> But what about the custom profile properties which can be configured in
> web.config? Can they be searched too? I guess it can by using foreach loop
> and test the contents on every user object.. but I thought maybe there was
a
> cleaner and faster way to do it...
> Lets say for example these are custom profile settings in web.config. any
> suggestion on how to search them? Lets say the search should return all
> users containing the phrase "Lets" in lastname? or all users of a specific
> gender?
> <profile enabled="true">
> <properties>
> <add name="FirstName" type="string"/>
> <add name="LastName" type="string"/>
> <add name="Gender" type="string"/>
> <add name="BirthDate" type="DateTime"/>
> </properties>
> </profile>
> Best Regards
>
>

newbie: inserting data into sql form writes only null values

Hi,

using VStudio 2005/sql server 2005

Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:

I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value

here's the code:using VStudio 2005/sql server 2005

Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:

I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value

here's the code:

<asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
Last name:
<asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
Address:
<asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
City:
<asp:TextBox ID="City" runat="server"></asp:TextBox><br />
Year created:
<asp:DropDownList ID="YearCreated" runat="server">
</asp:DropDownList><br />

<asp:Button ID="Save" runat="server" Text="Save" />
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString=
"<%$ ConnectionStrings:WHCConnectionString %>"
InsertCommand=
"INSERT INTO
[artsfestival] ([lastName], [firstName], [address], [city])
VALUES
(@.lastName, @.firstName, @.address, @.city)">
<InsertParameters>
<asp:FormParameter Name="lastName" Type="String"
FormField="LastName" />
<asp:FormParameter Name="firstName" Type="String"
FormField="FirstName" />
<asp:FormParameter Name="address" Type="String"
FormField="Address" />
<asp:FormParameter Name="city" Type="String"
FormField="City" />
</InsertParameters>
</asp:SqlDataSource>

"thersitz" <thersitz@.gmail.comwrote in message
news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi,
>
using VStudio 2005/sql server 2005
>
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds
a new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
>
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is
the only field that actually writes a correct value
>
here's the code:
>
>


Hi there,

Use

ControlParameter instead of FormParameter. The difference is that
FormParameter takes its value directly from Request.Form collection using the
name given by FormField. The problem with your vode is that, textbox does not
post its value in Request.Form[textBox.ID] but in
Request.Form[textBox.UniqueID] which reflects IDs of the parent controls.
Change you insertparameters declaration to:

<InsertParameters>
<asp:ControlParameter Name="lastName" Type="String" ControlID="LastName"
PropertyName="Text"/>
<asp:ControlParameter Name="firstName" ControlID="FirstName" Type="String"
PropertyName="Text"/>
<asp:ControlParameter Name="address" Type="String" ControlID="Address"
PropertyName="Text"/>
<asp:ControlParameter Name="city" Type="String" ControlID="City"
PropertyName="Text"/>
</InsertParameters>

--
Milosz

"thersitz" wrote:

Quote:

Originally Posted by

using VStudio 2005/sql server 2005
>
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
>
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value
>
here's the code:
>
<asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
Last name:
<asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
Address:
<asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
City:
<asp:TextBox ID="City" runat="server"></asp:TextBox><br />
Year created:
<asp:DropDownList ID="YearCreated" runat="server">
</asp:DropDownList><br />
>
<asp:Button ID="Save" runat="server" Text="Save" />
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString=
"<%$ ConnectionStrings:WHCConnectionString %>"
InsertCommand=
"INSERT INTO
[artsfestival] ([lastName], [firstName], [address], [city])
VALUES
(@.lastName, @.firstName, @.address, @.city)">
<InsertParameters>
<asp:FormParameter Name="lastName" Type="String"
FormField="LastName" />
<asp:FormParameter Name="firstName" Type="String"
FormField="FirstName" />
<asp:FormParameter Name="address" Type="String"
FormField="Address" />
<asp:FormParameter Name="city" Type="String"
FormField="City" />
</InsertParameters>
</asp:SqlDataSource>
>
>
>
>
"thersitz" <thersitz@.gmail.comwrote in message
news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi,

using VStudio 2005/sql server 2005

Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds
a new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:

I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is
the only field that actually writes a correct value

here's the code:


>
>
>


Thanks Milosz, it worked.

I'm confused why the book had me use the FormParameter and FormFieldID --
but thanks for getting me past this point.

Take care.

"Milosz Skalecki [MCAD]" <mily242@.REMOVEITwp.plwrote in message
news:1206D448-EDF2-419B-9A48-D05F7B51FAAF@.microsoft.com...

Quote:

Originally Posted by

Hi there,
>
Use
>
ControlParameter instead of FormParameter. The difference is that
FormParameter takes its value directly from Request.Form collection using
the
name given by FormField. The problem with your vode is that, textbox does
not
post its value in Request.Form[textBox.ID] but in
Request.Form[textBox.UniqueID] which reflects IDs of the parent controls.
Change you insertparameters declaration to:
>
<InsertParameters>
<asp:ControlParameter Name="lastName" Type="String" ControlID="LastName"
PropertyName="Text"/>
<asp:ControlParameter Name="firstName" ControlID="FirstName" Type="String"
PropertyName="Text"/>
<asp:ControlParameter Name="address" Type="String" ControlID="Address"
PropertyName="Text"/>
<asp:ControlParameter Name="city" Type="String" ControlID="City"
PropertyName="Text"/>
</InsertParameters>
>
--
Milosz
>
>
"thersitz" wrote:
>

Quote:

Originally Posted by

> using VStudio 2005/sql server 2005
>>
>Have a simple web form that inserts the results in a table. It seems to
>write to the table, but not the values from the asp forms fields. It adds
>a
>new record and increments the id field by one -- but in all the other
>fields, it merely writes Null to the fields. He are some other points:
>>
>I am not inserting data into every field -- for test purposes I am only
>using 4 fields.
>The id field is NOT one of the fields on the asp form -- although it is
>the
>only field that actually writes a correct value
>>
>here's the code:
>>
> <asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
> Last name:
> <asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
> Address:
> <asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
> City:
> <asp:TextBox ID="City" runat="server"></asp:TextBox><br />
> Year created:
> <asp:DropDownList ID="YearCreated" runat="server">
> </asp:DropDownList><br />
>>
> <asp:Button ID="Save" runat="server" Text="Save" />
> </div>
> <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ConnectionString=
> "<%$ ConnectionStrings:WHCConnectionString %>"
> InsertCommand=
> "INSERT INTO
> [artsfestival] ([lastName], [firstName], [address], [city])
> VALUES
> (@.lastName, @.firstName, @.address, @.city)">
> <InsertParameters>
> <asp:FormParameter Name="lastName" Type="String"
> FormField="LastName" />
> <asp:FormParameter Name="firstName" Type="String"
> FormField="FirstName" />
> <asp:FormParameter Name="address" Type="String"
> FormField="Address" />
> <asp:FormParameter Name="city" Type="String"
> FormField="City" />
> </InsertParameters>
> </asp:SqlDataSource>
>>
>>
>>
>>
>"thersitz" <thersitz@.gmail.comwrote in message
>news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi,
>
using VStudio 2005/sql server 2005
>
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It
adds
a new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
>
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is
the only field that actually writes a correct value
>
here's the code:
>
>


>>
>>
>>

newbie: installing visual web developer express 2005

Hey
When installing visual web developer 2005, the installation suggest
installing on C: But I want to install it on D:, because I only got 1.6 GB
available on C: and D has 30 GB available...
So I change installation location from C:\Program Files\Microsoft Visual
Studio 8\ -> D:\Program Files\Microsoft Visual Studio 8\...
But even if I change to D: the installation says it will install 1.8 GB on
C: and 78 MB on D: (When C: is selected, it install everything on C:, all
the 1.8GB)
Is it possible to install everything on D: or do have to delete files from
my C: to make space for visual web developer 2005 express? This is on a
winxp pro system. I want to have atleast 1GB free space on C: for swap files
etc (maybe I should change the swap file to d:)
any suggestions?
JeffHi Jeff,
The .NET Framework, on which VWDE relies, wants to be installed on the
system drive, which is probably C:.
You could move your swap file to D: and might even see a performance gain.
Ken
Microsoft MVP [ASP.NET]
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
> Hey
> When installing visual web developer 2005, the installation suggest
> installing on C: But I want to install it on D:, because I only got 1.6 GB
> available on C: and D has 30 GB available...
> So I change installation location from C:\Program Files\Microsoft Visual
> Studio 8\ -> D:\Program Files\Microsoft Visual Studio 8\...
> But even if I change to D: the installation says it will install 1.8 GB on
> C: and 78 MB on D: (When C: is selected, it install everything on C:, all
> the 1.8GB)
> Is it possible to install everything on D: or do have to delete files from
> my C: to make space for visual web developer 2005 express? This is on a
> winxp pro system. I want to have atleast 1GB free space on C: for swap
> files etc (maybe I should change the swap file to d:)
> any suggestions?
> Jeff
>
Hi, Jeff.
VS 2005 requires a lot of available space in the system drive,
although there's a lot of it you can install on a data drive.
The choice is available at setup time.
If you have 30GB free on D: and only 1.6 GB free on C:, what I'd suggest
is that you install WinXP Pro on D: and make D: your system drive.
You can then not have to worry about free system drive space, and you can ea
sily
install VWD Express and SQL Server 2005 Express on your new system drive ( D
: ).
You will breathe a lot easier after you do that.
Then, you could wipe clean your C: drive and place your swap file in it.
Sometimes, a clean break is a much better choice.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
> Hey
> When installing visual web developer 2005, the installation suggest instal
ling on C: But I want to
> install it on D:, because I only got 1.6 GB available on C: and D has 30 G
B available...
> So I change installation location from C:\Program Files\Microsoft Visual S
tudio 8\ -> D:\Program
> Files\Microsoft Visual Studio 8\...
> But even if I change to D: the installation says it will install 1.8 GB on
C: and 78 MB on D:
> (When C: is selected, it install everything on C:, all the 1.8GB)
> Is it possible to install everything on D: or do have to delete files from
my C: to make space for
> visual web developer 2005 express? This is on a winxp pro system. I want t
o have atleast 1GB free
> space on C: for swap files etc (maybe I should change the swap file to d:)
> any suggestions?
> Jeff
>
Thanks, I've installed VWDE now... and yes I've noticed a performance
increase on my computer after moving my pagefile to D:
"Ken Cox [Microsoft MVP]" <BANSPAMkjopc@.newsgroups.nospam> wrote in message
news:%23559F4SmGHA.4212@.TK2MSFTNGP03.phx.gbl...
> Hi Jeff,
> The .NET Framework, on which VWDE relies, wants to be installed on the
> system drive, which is probably C:.
> You could move your swap file to D: and might even see a performance gain.
> Ken
> Microsoft MVP [ASP.NET]
> "Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
> news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
>

newbie: installing visual web developer express 2005

Hey

When installing visual web developer 2005, the installation suggest
installing on C: But I want to install it on D:, because I only got 1.6 GB
available on C: and D has 30 GB available...

So I change installation location from C:\Program Files\Microsoft Visual
Studio 8\ -> D:\Program Files\Microsoft Visual Studio 8\...

But even if I change to D: the installation says it will install 1.8 GB on
C: and 78 MB on D: (When C: is selected, it install everything on C:, all
the 1.8GB)

Is it possible to install everything on D: or do have to delete files from
my C: to make space for visual web developer 2005 express? This is on a
winxp pro system. I want to have atleast 1GB free space on C: for swap files
etc (maybe I should change the swap file to d:)

any suggestions?

JeffHi Jeff,

The .NET Framework, on which VWDE relies, wants to be installed on the
system drive, which is probably C:.

You could move your swap file to D: and might even see a performance gain.

Ken
Microsoft MVP [ASP.NET]

"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
> Hey
> When installing visual web developer 2005, the installation suggest
> installing on C: But I want to install it on D:, because I only got 1.6 GB
> available on C: and D has 30 GB available...
> So I change installation location from C:\Program Files\Microsoft Visual
> Studio 8\ -> D:\Program Files\Microsoft Visual Studio 8\...
> But even if I change to D: the installation says it will install 1.8 GB on
> C: and 78 MB on D: (When C: is selected, it install everything on C:, all
> the 1.8GB)
> Is it possible to install everything on D: or do have to delete files from
> my C: to make space for visual web developer 2005 express? This is on a
> winxp pro system. I want to have atleast 1GB free space on C: for swap
> files etc (maybe I should change the swap file to d:)
> any suggestions?
> Jeff
Hi, Jeff.

VS 2005 requires a lot of available space in the system drive,
although there's a lot of it you can install on a data drive.

The choice is available at setup time.

If you have 30GB free on D: and only 1.6 GB free on C:, what I'd suggest
is that you install WinXP Pro on D: and make D: your system drive.

You can then not have to worry about free system drive space, and you can easily
install VWD Express and SQL Server 2005 Express on your new system drive ( D: ).

You will breathe a lot easier after you do that.
Then, you could wipe clean your C: drive and place your swap file in it.

Sometimes, a clean break is a much better choice.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
> Hey
> When installing visual web developer 2005, the installation suggest installing on C: But I want to
> install it on D:, because I only got 1.6 GB available on C: and D has 30 GB available...
> So I change installation location from C:\Program Files\Microsoft Visual Studio 8\ -> D:\Program
> Files\Microsoft Visual Studio 8\...
> But even if I change to D: the installation says it will install 1.8 GB on C: and 78 MB on D:
> (When C: is selected, it install everything on C:, all the 1.8GB)
> Is it possible to install everything on D: or do have to delete files from my C: to make space for
> visual web developer 2005 express? This is on a winxp pro system. I want to have atleast 1GB free
> space on C: for swap files etc (maybe I should change the swap file to d:)
> any suggestions?
> Jeff
Thanks, I've installed VWDE now... and yes I've noticed a performance
increase on my computer after moving my pagefile to D:

"Ken Cox [Microsoft MVP]" <BANSPAMkjopc@.newsgroups.nospam> wrote in message
news:%23559F4SmGHA.4212@.TK2MSFTNGP03.phx.gbl...
> Hi Jeff,
> The .NET Framework, on which VWDE relies, wants to be installed on the
> system drive, which is probably C:.
> You could move your swap file to D: and might even see a performance gain.
> Ken
> Microsoft MVP [ASP.NET]
> "Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
> news:uPpsOMSmGHA.2160@.TK2MSFTNGP04.phx.gbl...
>> Hey
>>
>> When installing visual web developer 2005, the installation suggest
>> installing on C: But I want to install it on D:, because I only got 1.6
>> GB available on C: and D has 30 GB available...
>>
>> So I change installation location from C:\Program Files\Microsoft Visual
>> Studio 8\ -> D:\Program Files\Microsoft Visual Studio 8\...
>>
>> But even if I change to D: the installation says it will install 1.8 GB
>> on C: and 78 MB on D: (When C: is selected, it install everything on C:,
>> all the 1.8GB)
>>
>> Is it possible to install everything on D: or do have to delete files
>> from my C: to make space for visual web developer 2005 express? This is
>> on a winxp pro system. I want to have atleast 1GB free space on C: for
>> swap files etc (maybe I should change the swap file to d:)
>>
>> any suggestions?
>>
>> Jeff
>>

newbie: inserting data into sql form writes only null values

Hi,
using VStudio 2005/sql server 2005
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value
here's the code:using VStudio 2005/sql server 2005
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value
here's the code:
<asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
Last name:
<asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
Address:
<asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
City:
<asp:TextBox ID="City" runat="server"></asp:TextBox><br />
Year created:
<asp:DropDownList ID="YearCreated" runat="server">
</asp:DropDownList><br />
<asp:Button ID="Save" runat="server" Text="Save" />
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString=
"<%$ ConnectionStrings:WHCConnectionString %>"
InsertCommand=
"INSERT INTO
[artsfestival] ([lastName], [firstName], [address], [city])
VALUES
(@.lastName, @.firstName, @.address, @.city)">
<InsertParameters>
<asp:FormParameter Name="lastName" Type="String"
FormField="LastName" />
<asp:FormParameter Name="firstName" Type="String"
FormField="FirstName" />
<asp:FormParameter Name="address" Type="String"
FormField="Address" />
<asp:FormParameter Name="city" Type="String"
FormField="City" />
</InsertParameters>
</asp:SqlDataSource>
"thersitz" <thersitz@.gmail.com> wrote in message
news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...
> Hi,
> using VStudio 2005/sql server 2005
> Have a simple web form that inserts the results in a table. It seems to
> write to the table, but not the values from the asp forms fields. It adds
> a new record and increments the id field by one -- but in all the other
> fields, it merely writes Null to the fields. He are some other points:
> I am not inserting data into every field -- for test purposes I am only
> using 4 fields.
> The id field is NOT one of the fields on the asp form -- although it is
> the only field that actually writes a correct value
> here's the code:
>
Hi there,
Use
ControlParameter instead of FormParameter. The difference is that
FormParameter takes its value directly from Request.Form collection using th
e
name given by FormField. The problem with your vode is that, textbox does no
t
post its value in Request.Form[textBox.ID] but in
Request.Form[textBox.UniqueID] which reflects IDs of the parent controls.
Change you insertparameters declaration to:
<InsertParameters>
<asp:ControlParameter Name="lastName" Type="String" ControlID="LastName"
PropertyName="Text"/>
<asp:ControlParameter Name="firstName" ControlID="FirstName" Type="String"
PropertyName="Text"/>
<asp:ControlParameter Name="address" Type="String" ControlID="Address"
PropertyName="Text"/>
<asp:ControlParameter Name="city" Type="String" ControlID="City"
PropertyName="Text"/>
</InsertParameters>
Milosz
"thersitz" wrote:

> using VStudio 2005/sql server 2005
> Have a simple web form that inserts the results in a table. It seems to
> write to the table, but not the values from the asp forms fields. It adds
a
> new record and increments the id field by one -- but in all the other
> fields, it merely writes Null to the fields. He are some other points:
> I am not inserting data into every field -- for test purposes I am only
> using 4 fields.
> The id field is NOT one of the fields on the asp form -- although it is th
e
> only field that actually writes a correct value
> here's the code:
> <asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
> Last name:
> <asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
> Address:
> <asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
> City:
> <asp:TextBox ID="City" runat="server"></asp:TextBox><br />
> Year created:
> <asp:DropDownList ID="YearCreated" runat="server">
> </asp:DropDownList><br />
> <asp:Button ID="Save" runat="server" Text="Save" />
> </div>
> <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ConnectionString=
> "<%$ ConnectionStrings:WHCConnectionString %>"
> InsertCommand=
> "INSERT INTO
> [artsfestival] ([lastName], [firstName], [address], [city])
> VALUES
> (@.lastName, @.firstName, @.address, @.city)">
> <InsertParameters>
> <asp:FormParameter Name="lastName" Type="String"
> FormField="LastName" />
> <asp:FormParameter Name="firstName" Type="String"
> FormField="FirstName" />
> <asp:FormParameter Name="address" Type="String"
> FormField="Address" />
> <asp:FormParameter Name="city" Type="String"
> FormField="City" />
> </InsertParameters>
> </asp:SqlDataSource>
>
>
> "thersitz" <thersitz@.gmail.com> wrote in message
> news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...
>
>
Thanks Milosz, it worked.
I'm why the book had me use the FormParameter and FormFieldID --
but thanks for getting me past this point.
Take care.
"Milosz Skalecki [MCAD]" <mily242@.REMOVEITwp.pl> wrote in message
news:1206D448-EDF2-419B-9A48-D05F7B51FAAF@.microsoft.com...
> Hi there,
> Use
> ControlParameter instead of FormParameter. The difference is that
> FormParameter takes its value directly from Request.Form collection using
> the
> name given by FormField. The problem with your vode is that, textbox does
> not
> post its value in Request.Form[textBox.ID] but in
> Request.Form[textBox.UniqueID] which reflects IDs of the parent controls.
> Change you insertparameters declaration to:
> <InsertParameters>
> <asp:ControlParameter Name="lastName" Type="String" ControlID="LastName"
> PropertyName="Text"/>
> <asp:ControlParameter Name="firstName" ControlID="FirstName" Type="String"
> PropertyName="Text"/>
> <asp:ControlParameter Name="address" Type="String" ControlID="Address"
> PropertyName="Text"/>
> <asp:ControlParameter Name="city" Type="String" ControlID="City"
> PropertyName="Text"/>
> </InsertParameters>
> --
> Milosz
>
> "thersitz" wrote:
>

Monday, March 26, 2012

newbie: Master pages... dynamic content...

Using VS2005, VB codebehind,
I'm porting a windows app to the web - My main page is very simple and
will look something like this:
----
| Title |
----
| | button navigation bar |
| | ---|
| | |
| Menu| |
| | Content |
| | |
| | |
| | |
---
Menu is a treeview control that is (potientially) different for each
user that visits the site. (nodes are dynamically populated in the
treeview via code behind based on user's role and auth. level)
The Content can be any object renderable by a browser (HTM, flash, pdf,
office document, etc).
The question is can i display different web forms in the content part
when the menu is clicked?
I've looked at master pages but from what I understand they would only
be able to display HTM in the "Content" area. Does anyone have any
ideas on how to allow the content area to display other types of
objects?
Can anyone help a web rookie ?You have some incorrect notions.
Master pages can have dynamic content. The isue is they are a little harder
to ahve the page update master page content, but it is not impossible. And,
if you have the master page render dynamically, there is no issue. I see no
reason why a user driven menu cannot be placed in a master page.
If you use master pages, the different content is fairly easy. If not, you
will need another option. DotNet Nuke is an option and would be easier than
rolling your own.
Third choice, way out in left field, is to create your own engine to render
the pages. I would inherit from page to do this, as you can have your class
handle most of the lifting. User controls are also an option for content, if
you wish to use a model-view-controller type of set up. I would shy away
from any of these choices, esp. as a rookie, unless the master pages and
DotNet Nuke fail to work.
NOTE: Check out the starter kits under downloads at www.asp.net. They will
give you a good framework to start from.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
****************************************
****
Think outside the box!
****************************************
****
"celoftis" <celoftis@.gmail.com> wrote in message
news:1168276140.365434.16250@.42g2000cwt.googlegroups.com...
> Using VS2005, VB codebehind,
> I'm porting a windows app to the web - My main page is very simple and
> will look something like this:
> ----
> | Title |
> ----
> | | button navigation bar |
> | | ---|
> | | |
> | Menu| |
> | | Content |
> | | |
> | | |
> | | |
> ---
> Menu is a treeview control that is (potientially) different for each
> user that visits the site. (nodes are dynamically populated in the
> treeview via code behind based on user's role and auth. level)
> The Content can be any object renderable by a browser (HTM, flash, pdf,
> office document, etc).
> The question is can i display different web forms in the content part
> when the menu is clicked?
> I've looked at master pages but from what I understand they would only
> be able to display HTM in the "Content" area. Does anyone have any
> ideas on how to allow the content area to display other types of
> objects?
> Can anyone help a web rookie ?
>
I have a treeview in a master page, and I display pdf files(EKGs and X-Rays)
in the content pages using an <embed> tag. The 'src' attribute of the embed
tag is assigned when the content page loads based on the query string used
to open the content page when a treeview node is clicked.
"celoftis" <celoftis@.gmail.com> wrote in message
news:1168276140.365434.16250@.42g2000cwt.googlegroups.com...
> Using VS2005, VB codebehind,
> I'm porting a windows app to the web - My main page is very simple and
> will look something like this:
> ----
> | Title |
> ----
> | | button navigation bar |
> | | ---|
> | | |
> | Menu| |
> | | Content |
> | | |
> | | |
> | | |
> ---
> Menu is a treeview control that is (potientially) different for each
> user that visits the site. (nodes are dynamically populated in the
> treeview via code behind based on user's role and auth. level)
> The Content can be any object renderable by a browser (HTM, flash, pdf,
> office document, etc).
> The question is can i display different web forms in the content part
> when the menu is clicked?
> I've looked at master pages but from what I understand they would only
> be able to display HTM in the "Content" area. Does anyone have any
> ideas on how to allow the content area to display other types of
> objects?
> Can anyone help a web rookie ?
>
Gregory,
Thanks for the reply. I'm excited at the possibility of making this
work.
I've got hundreds (if not a thousand) content pages that I need to be
target for the "child page". Problem is I don't want to modify all
the pages - in fact, the majority of the pages are on remote servers
that I have no access to - so I really just need to be able to point
to a URL and have it load in the child page. Can I still use master
pages to make this work?
I've reviewed ASP.NET downloads haven't found anything that suits my
situation - any other pointer or code snippets would be greatly
appreciated! Please Let me know what you think either way.
celoftis
Thanks... I'll keep that in mind.
The content inside a 'child page' needs to be inside a ContentPlaceHolderID
control. Also - the page needs to have the .aspx extension and have a
reference at the top of that content page, to the master page.
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"celoftis" <celoftis@.gmail.com> wrote in message
news:1168447380.383686.248680@.i56g2000hsf.googlegroups.com...
> Gregory,
> Thanks for the reply. I'm excited at the possibility of making this
> work.
> I've got hundreds (if not a thousand) content pages that I need to be
> target for the "child page". Problem is I don't want to modify all
> the pages - in fact, the majority of the pages are on remote servers
> that I have no access to - so I really just need to be able to point
> to a URL and have it load in the child page. Can I still use master
> pages to make this work?
> I've reviewed ASP.NET downloads haven't found anything that suits my
> situation - any other pointer or code snippets would be greatly
> appreciated! Please Let me know what you think either way.
> celoftis
>
David,
Thanks for the reply...
So, for my specifc situation (not being able to access all the content
pages), it looks like master pages are not going to work - do you
agree?
But if I could modify the content of all the child pages, then I could
use a script to wrap the existing page(s) with
ContentPlaceHolderID(s)... seems real messy.

newbie: Master pages... dynamic content...

Using VS2005, VB codebehind,
I'm porting a windows app to the web - My main page is very simple and
will look something like this:
----------------
| Title |
----------------
| | button navigation bar |
| | ------------|
| | |
| Menu| |
| | Content |
| | |
| | |
| | |
---------------

Menu is a treeview control that is (potientially) different for each
user that visits the site. (nodes are dynamically populated in the
treeview via code behind based on user's role and auth. level)

The Content can be any object renderable by a browser (HTM, flash, pdf,
office document, etc).

The question is can i display different web forms in the content part
when the menu is clicked?

I've looked at master pages but from what I understand they would only
be able to display HTM in the "Content" area. Does anyone have any
ideas on how to allow the content area to display other types of
objects?
Can anyone help a web rookie ?You have some incorrect notions.

Master pages can have dynamic content. The isue is they are a little harder
to ahve the page update master page content, but it is not impossible. And,
if you have the master page render dynamically, there is no issue. I see no
reason why a user driven menu cannot be placed in a master page.

If you use master pages, the different content is fairly easy. If not, you
will need another option. DotNet Nuke is an option and would be easier than
rolling your own.

Third choice, way out in left field, is to create your own engine to render
the pages. I would inherit from page to do this, as you can have your class
handle most of the lifting. User controls are also an option for content, if
you wish to use a model-view-controller type of set up. I would shy away
from any of these choices, esp. as a rookie, unless the master pages and
DotNet Nuke fail to work.

NOTE: Check out the starter kits under downloads at www.asp.net. They will
give you a good framework to start from.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
********************************************
Think outside the box!
********************************************
"celoftis" <celoftis@.gmail.comwrote in message
news:1168276140.365434.16250@.42g2000cwt.googlegrou ps.com...

Quote:

Originally Posted by

Using VS2005, VB codebehind,
I'm porting a windows app to the web - My main page is very simple and
will look something like this:
----------------
| Title |
----------------
| | button navigation bar |
| | ------------|
| | |
| Menu| |
| | Content |
| | |
| | |
| | |
---------------
>
Menu is a treeview control that is (potientially) different for each
user that visits the site. (nodes are dynamically populated in the
treeview via code behind based on user's role and auth. level)
>
The Content can be any object renderable by a browser (HTM, flash, pdf,
office document, etc).
>
The question is can i display different web forms in the content part
when the menu is clicked?
>
I've looked at master pages but from what I understand they would only
be able to display HTM in the "Content" area. Does anyone have any
ideas on how to allow the content area to display other types of
objects?
Can anyone help a web rookie ?
>


I have a treeview in a master page, and I display pdf files(EKGs and X-Rays)
in the content pages using an <embedtag. The 'src' attribute of the embed
tag is assigned when the content page loads based on the query string used
to open the content page when a treeview node is clicked.

"celoftis" <celoftis@.gmail.comwrote in message
news:1168276140.365434.16250@.42g2000cwt.googlegrou ps.com...

Quote:

Originally Posted by

Using VS2005, VB codebehind,
I'm porting a windows app to the web - My main page is very simple and
will look something like this:
----------------
| Title |
----------------
| | button navigation bar |
| | ------------|
| | |
| Menu| |
| | Content |
| | |
| | |
| | |
---------------
>
Menu is a treeview control that is (potientially) different for each
user that visits the site. (nodes are dynamically populated in the
treeview via code behind based on user's role and auth. level)
>
The Content can be any object renderable by a browser (HTM, flash, pdf,
office document, etc).
>
The question is can i display different web forms in the content part
when the menu is clicked?
>
I've looked at master pages but from what I understand they would only
be able to display HTM in the "Content" area. Does anyone have any
ideas on how to allow the content area to display other types of
objects?
Can anyone help a web rookie ?
>


Gregory,
Thanks for the reply. I'm excited at the possibility of making this
work.
I've got hundreds (if not a thousand) content pages that I need to be
target for the "child page". Problem is I don't want to modify all
the pages - in fact, the majority of the pages are on remote servers
that I have no access to - so I really just need to be able to point
to a URL and have it load in the child page. Can I still use master
pages to make this work?

I've reviewed ASP.NET downloads haven't found anything that suits my
situation - any other pointer or code snippets would be greatly
appreciated! Please Let me know what you think either way.

celoftis
Thanks... I'll keep that in mind.
The content inside a 'child page' needs to be inside a ContentPlaceHolderID
control. Also - the page needs to have the .aspx extension and have a
reference at the top of that content page, to the master page.

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"celoftis" <celoftis@.gmail.comwrote in message
news:1168447380.383686.248680@.i56g2000hsf.googlegr oups.com...

Quote:

Originally Posted by

Gregory,
Thanks for the reply. I'm excited at the possibility of making this
work.
I've got hundreds (if not a thousand) content pages that I need to be
target for the "child page". Problem is I don't want to modify all
the pages - in fact, the majority of the pages are on remote servers
that I have no access to - so I really just need to be able to point
to a URL and have it load in the child page. Can I still use master
pages to make this work?
>
I've reviewed ASP.NET downloads haven't found anything that suits my
situation - any other pointer or code snippets would be greatly
appreciated! Please Let me know what you think either way.
>
celoftis
>


David,
Thanks for the reply...

So, for my specifc situation (not being able to access all the content
pages), it looks like master pages are not going to work - do you
agree?

But if I could modify the content of all the child pages, then I could
use a script to wrap the existing page(s) with
ContentPlaceHolderID(s)... seems real messy.

newbie: Need help with this bug/exception

Hey

ASP.NET 2.0

this code "private MembershipUserCollection allUsers =
Membership.GetAllUsers();" crashes my web portal. Below you see the inner
exception

Innet Exception:

System.Configuration.ConfigurationErrorsException was unhandled by user code
Message="Could not load file or assembly 'System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' or one of its dependencies.
The system cannot find the file specified. (C:\\Documents and
Settings\\Test\\My Documents\\Visual Studio 2005\\WebSites\\Test\\web.config
line 53)"
Source="System.Web"
BareMessage="Could not load file or assembly 'System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' or one of its dependencies.
The system cannot find the file specified."
Filename="C:\\Documents and Settings\\Test\\My Documents\\Visual Studio
2005\\WebSites\\Test\\web.config"
Line=53
StackTrace:
at System.Web.Configuration.ConfigUtil.GetType(String typeName,
String propertyName, ConfigurationElement configElement, XmlNode node,
Boolean checkAptcaBit, Boolean ignoreCase)
at System.Web.Configuration.ConfigUtil.GetType(String typeName,
String propertyName, ConfigurationElement configElement, Boolean
checkAptcaBit, Boolean ignoreCase)
at
System.Web.Configuration.ProvidersHelper.Instantia teProvider(ProviderSettings
providerSettings, Type providerType)
at
System.Web.Configuration.ProvidersHelper.Instantia teProviders(ProviderSettingsCollection
configProviders, ProviderCollection providers, Type providerType)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.get_Provider()
at System.Web.Security.Membership.GetAllUsers(Int32 pageIndex, Int32
pageSize, Int32& totalRecords)
at System.Web.Security.Membership.GetAllUsers()
at Admin_Default..ctor() in c:\Documents and Settings\Test\My
Documents\Visual Studio 2005\WebSites\Test\Admin\Default.aspx.cs:line 14
at ASP.admin_default_aspx..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\Test\0570c87d\5d2b6186\App_Web_suvoevfs.0.cs :line 0
at
__ASP.FastObjectFactory_app_web_suvoevfs.Create_AS P_admin_default_aspx() in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\Test\0570c87d\5d2b6186\App_Web_suvoevfs.2.cs :line 0
at System.Web.Compilation.BuildResultCompiledType.Cre ateInstance()
at
System.Web.Compilation.BuildManager.CreateInstance FromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper( HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at
System.Web.UI.PageHandlerFactory.System.Web.IHttpH andlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, VirtualPath path, String pathTranslated, Boolean
useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep .System.Web.HttpApplication.IExecutionStep.Execute ()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)

This is my membership provider (web.config)

<membership defaultProvider="AH_MembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<add name="AH_MembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="/"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Encrypted"
maxInvalidPasswordAttempts="5"
passwordAttemptWindows="10"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' " />
</providers>
</membership>

Any suggestions on how to solve this problem?

Best Regards

JeffThere are instances where you need to strip out the garbage from a site,
esp. if you publish instead of just copy all source (the latter being a bad
thing in a production site). Open the web config and remove the assemblies
add lines for the dlls in question (under <compilation>). If you have
already compiled (published), they are not needed anyway. That is what I
would try first. If it does not work, follow up and the issue can be dug
into deeper.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:uwrVWnR3GHA.1568@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Hey
>
ASP.NET 2.0
>
this code "private MembershipUserCollection allUsers =
Membership.GetAllUsers();" crashes my web portal. Below you see the inner
exception
>
Innet Exception:
>
System.Configuration.ConfigurationErrorsException was unhandled by user
code
Message="Could not load file or assembly 'System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' or one of its
dependencies. The system cannot find the file specified. (C:\\Documents
and Settings\\Test\\My Documents\\Visual Studio
2005\\WebSites\\Test\\web.config line 53)"
Source="System.Web"
BareMessage="Could not load file or assembly 'System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' or one
of its dependencies. The system cannot find the file specified."
Filename="C:\\Documents and Settings\\Test\\My Documents\\Visual Studio
2005\\WebSites\\Test\\web.config"
Line=53
StackTrace:
at System.Web.Configuration.ConfigUtil.GetType(String typeName,
String propertyName, ConfigurationElement configElement, XmlNode node,
Boolean checkAptcaBit, Boolean ignoreCase)
at System.Web.Configuration.ConfigUtil.GetType(String typeName,
String propertyName, ConfigurationElement configElement, Boolean
checkAptcaBit, Boolean ignoreCase)
at
System.Web.Configuration.ProvidersHelper.Instantia teProvider(ProviderSettings
providerSettings, Type providerType)
at
System.Web.Configuration.ProvidersHelper.Instantia teProviders(ProviderSettingsCollection
configProviders, ProviderCollection providers, Type providerType)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.get_Provider()
at System.Web.Security.Membership.GetAllUsers(Int32 pageIndex, Int32
pageSize, Int32& totalRecords)
at System.Web.Security.Membership.GetAllUsers()
at Admin_Default..ctor() in c:\Documents and Settings\Test\My
Documents\Visual Studio 2005\WebSites\Test\Admin\Default.aspx.cs:line 14
at ASP.admin_default_aspx..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\Test\0570c87d\5d2b6186\App_Web_suvoevfs.0.cs :line 0
at
__ASP.FastObjectFactory_app_web_suvoevfs.Create_AS P_admin_default_aspx()
in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\Test\0570c87d\5d2b6186\App_Web_suvoevfs.2.cs :line 0
at System.Web.Compilation.BuildResultCompiledType.Cre ateInstance()
at
System.Web.Compilation.BuildManager.CreateInstance FromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper( HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at
System.Web.UI.PageHandlerFactory.System.Web.IHttpH andlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, VirtualPath path, String pathTranslated, Boolean
useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep .System.Web.HttpApplication.IExecutionStep.Execute ()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
>
>
This is my membership provider (web.config)
>
<membership defaultProvider="AH_MembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<add name="AH_MembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="/"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Encrypted"
maxInvalidPasswordAttempts="5"
passwordAttemptWindows="10"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaa' " />
</providers>
</membership>
>
Any suggestions on how to solve this problem?
>
Best Regards
>
Jeff
>
>

Newbie: Open other form when link is clicked

I have a hyperlink on my Web form (home.aspx). I want to open another
form (Login.aspx) when user clicks this link. How to do this? I also
want to maintain site map when another form gets opened."Rohit" <rpk.general@.gmail.comwrote in message
news:1192811576.682143.41250@.e34g2000pro.googlegro ups.com...

Quote:

Originally Posted by

I have a hyperlink on my Web form (home.aspx). I want to open another
form (Login.aspx) when user clicks this link. How to do this?


Well, the obvious answer is to change the hyperlink to point to Login.aspx
instead of home.aspx, but I guess that's not what you really mean...

Can you explain in a bit more detail what you're trying to do...

--
Mark Rae
ASP.NET MVP
http://www.markrae.net
In the client-side click event of the link, call window.open ('popup.aspx");

"Rohit" wrote:

Quote:

Originally Posted by

I have a hyperlink on my Web form (home.aspx). I want to open another
form (Login.aspx) when user clicks this link. How to do this? I also
want to maintain site map when another form gets opened.
>
>

newbie: Problem getting the querystring!

hey

asp.net 2.0

in the page_load event of a web page I place this code:
NameValueCollection parameters = Request.QueryString;
string username = parameters[0].ToString();

The URL has a querystring, for example like this: Default.aspx?user=newbie

But this code don't get the querystring, the parameters collection gets no
entries from this line "NameValueCollection parameters =
Request.QueryString;"

What am I doing wrong here?

JeffJeff wrote:

Quote:

Originally Posted by

hey
>
asp.net 2.0
>
in the page_load event of a web page I place this code:
NameValueCollection parameters = Request.QueryString;
string username = parameters[0].ToString();
>
The URL has a querystring, for example like this: Default.aspx?user=newbie
>
But this code don't get the querystring, the parameters collection gets no
entries from this line "NameValueCollection parameters =
Request.QueryString;"
>
What am I doing wrong here?
>
Jeff


string username = Request.QueryString["user"];
Best bet is to access the querystring collection directly. I'm not sure if
it's something that can do like this, as normally a lot of collections are
copied using the CopyTo method, but this is usually done for arrays not
specialized collections.

Your best bet though is to access it directly from the querystring. Also,
don't use positional identifiers to determine a parameter, it's too easy to
change the order that things will appear in so it's best to use the keyname
instead. Also, don't forget to test for null first or else it'll bomb out
when you run into a case where it's an empty value, that's the most common
gatcha when using the querystring.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:udZYNHc%23GHA.4472@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

hey
>
asp.net 2.0
>
in the page_load event of a web page I place this code:
NameValueCollection parameters = Request.QueryString;
string username = parameters[0].ToString();
>
The URL has a querystring, for example like this: Default.aspx?user=newbie
>
But this code don't get the querystring, the parameters collection gets no
entries from this line "NameValueCollection parameters =
Request.QueryString;"
>
What am I doing wrong here?
>
Jeff
>


Default.aspx?user=newbie
string username = Request.QueryString["user"]; gives username a NULL
value...

Any more suggestions?

"Simon Rigby" <google@.simonrigby.co.ukwrote in message
news:1161951708.089584.264150@.m7g2000cwm.googlegro ups.com...

Quote:

Originally Posted by

>
Jeff wrote:

Quote:

Originally Posted by

>hey
>>
>asp.net 2.0
>>
>in the page_load event of a web page I place this code:
>NameValueCollection parameters = Request.QueryString;
>string username = parameters[0].ToString();
>>
>The URL has a querystring, for example like this:
>Default.aspx?user=newbie
>>
>But this code don't get the querystring, the parameters collection gets
>no
>entries from this line "NameValueCollection parameters =
>Request.QueryString;"
>>
>What am I doing wrong here?
>>
>Jeff


>
string username = Request.QueryString["user"];
>


"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:udZYNHc%23GHA.4472@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

hey
>
asp.net 2.0
>
in the page_load event of a web page I place this code:
NameValueCollection parameters = Request.QueryString;
string username = parameters[0].ToString();
>
The URL has a querystring, for example like this: Default.aspx?user=newbie
>
But this code don't get the querystring, the parameters collection gets no
entries from this line "NameValueCollection parameters =
Request.QueryString;"
>
What am I doing wrong here?
>
Jeff
>


I usually use the form
if Request.QueryString.Item("_o") <string.empty then
stroID = Request.QueryString.Item("_o").tostring()
end if

to get the whole collection you can use

Dim coll As NameValueCollection
coll=request.querystring

and then you can access it using coll("_o") for example

Mike
It's my own fault... I thought the URL had a querystring, but because I had
set a breakpoint and then checked the URL during debug, I didn't see the
real URL, I only saw the last URL....

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:udZYNHc%23GHA.4472@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

hey
>
asp.net 2.0
>
in the page_load event of a web page I place this code:
NameValueCollection parameters = Request.QueryString;
string username = parameters[0].ToString();
>
The URL has a querystring, for example like this: Default.aspx?user=newbie
>
But this code don't get the querystring, the parameters collection gets no
entries from this line "NameValueCollection parameters =
Request.QueryString;"
>
What am I doing wrong here?
>
Jeff
>