Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts

Thursday, March 29, 2012

newbie: I don't want my .aspx and .cs files to have the source viewable by the client

I'm creating a C# .net project, for a client. However they only have the
right to the binaries, not the source code. Is there a way to compile it so
that I just give them dll's? or do they need the .aspx pages. I read
somewhere that I could probably make assemblies (excuse my bad terminology)
of the source code, but that it is quiet easy to disassemble the assemblies,
so that does not seem to afford read protection.
or am I just all over nothing!
thanksYou need to give them the ASPX pages and the compiled DLLs, but you do not
need to give them the .CS source code files.
If they are unethical they could decombile the DLLs to get a rough
approximation of the source code, but you can thwart them with an
Obfuscator.
Visual Studio 2003 has a basic built in obfuscator, but for 2002 you'll need
a 3rd party solution.
Here's more information on obfuscators:
http://www.abderaware.com/WhitePapers/Obfuscator.htm
http://www.preemptive.com/dotfuscator/index.html
http://www.devx.com/SummitDays/Article/11351
http://www.lesser-software.com/ilobf.htm
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Seth Broomer" <asdf@.asdsd.com> wrote in message
news:eWLgn06jEHA.1656@.TK2MSFTNGP09.phx.gbl...
> I'm creating a C# .net project, for a client. However they only have the
> right to the binaries, not the source code. Is there a way to compile it
> so
> that I just give them dll's? or do they need the .aspx pages. I read
> somewhere that I could probably make assemblies (excuse my bad
> terminology)
> of the source code, but that it is quiet easy to disassemble the
> assemblies,
> so that does not seem to afford read protection.
> or am I just all over nothing!
> thanks
>

newbie: I dont want my .aspx and .cs files to have the source viewable by the client

I'm creating a C# .net project, for a client. However they only have the
right to the binaries, not the source code. Is there a way to compile it so
that I just give them dll's? or do they need the .aspx pages. I read
somewhere that I could probably make assemblies (excuse my bad terminology)
of the source code, but that it is quiet easy to disassemble the assemblies,
so that does not seem to afford read protection.

or am I just all confused over nothing!

thanksYou need to give them the ASPX pages and the compiled DLLs, but you do not
need to give them the .CS source code files.
If they are unethical they could decombile the DLLs to get a rough
approximation of the source code, but you can thwart them with an
Obfuscator.
Visual Studio 2003 has a basic built in obfuscator, but for 2002 you'll need
a 3rd party solution.

Here's more information on obfuscators:
http://www.abderaware.com/WhitePapers/Obfuscator.htm
http://www.preemptive.com/dotfuscator/index.html
http://www.devx.com/SummitDays/Article/11351
http://www.lesser-software.com/ilobf.htm

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Seth Broomer" <asdf@.asdsd.com> wrote in message
news:eWLgn06jEHA.1656@.TK2MSFTNGP09.phx.gbl...
> I'm creating a C# .net project, for a client. However they only have the
> right to the binaries, not the source code. Is there a way to compile it
> so
> that I just give them dll's? or do they need the .aspx pages. I read
> somewhere that I could probably make assemblies (excuse my bad
> terminology)
> of the source code, but that it is quiet easy to disassemble the
> assemblies,
> so that does not seem to afford read protection.
> or am I just all confused over nothing!
> thanks
FYI - Just remember there are Deobfuscator out there. But at least you are
taking some sort of measure to secure the DLLs.

"Steve C. Orr [MVP, MCSD]" wrote:

> You need to give them the ASPX pages and the compiled DLLs, but you do not
> need to give them the .CS source code files.
> If they are unethical they could decombile the DLLs to get a rough
> approximation of the source code, but you can thwart them with an
> Obfuscator.
> Visual Studio 2003 has a basic built in obfuscator, but for 2002 you'll need
> a 3rd party solution.
> Here's more information on obfuscators:
> http://www.abderaware.com/WhitePapers/Obfuscator.htm
> http://www.preemptive.com/dotfuscator/index.html
> http://www.devx.com/SummitDays/Article/11351
> http://www.lesser-software.com/ilobf.htm
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
>
> "Seth Broomer" <asdf@.asdsd.com> wrote in message
> news:eWLgn06jEHA.1656@.TK2MSFTNGP09.phx.gbl...
> > I'm creating a C# .net project, for a client. However they only have the
> > right to the binaries, not the source code. Is there a way to compile it
> > so
> > that I just give them dll's? or do they need the .aspx pages. I read
> > somewhere that I could probably make assemblies (excuse my bad
> > terminology)
> > of the source code, but that it is quiet easy to disassemble the
> > assemblies,
> > so that does not seem to afford read protection.
> > or am I just all confused over nothing!
> > thanks
>

Monday, March 26, 2012

newbie: Problem with CustomValidator

Hey

asp.net 2.0

I'm creating a web site where people must register to get access to
restricted area. In the CreateUserWizard control I've added a check on email
is unique (see the code below).. The problem is that this UniqueEmail method
isn't triggered when leaving the Email field or submitting the
CreateUserWizard (click on the finish button)

<asp:CustomValidator ID="valUniqueEmail" runat="server" ErrorMessage="Your
Email address is already taken" ControlToValidate="Email"
OnServerValidate="UniqueEmail"></asp:CustomValidator>

protected void UniqueEmail(object source, ServerValidateEventArgs args)
{
MembershipUserCollection allUsers = Membership.GetAllUsers();
Debug.WriteLine("UniqueEmail");
foreach (MembershipUser user in allUsers)
{
if (user.Email == args.Value)
{
Debug.WriteLine("Testing " + user.UserName + " against " +
args.Value);
args.IsValid = false;
}
}
}

Any suggestions?

JeffHi Jeff,

Few things:

1. If EnableClientValidation is set to false, when you leav the control,
validation is not preformed (value is only validated when page is posted
back). In addition to that, CustomValidator control exposes ValidateEmptyText
property, which should be set to true if you expect empty text is considered
as a valid value for validation.

2. Because you're utilizing event wire up, make sure AutoEventWireup is set
to true in <@.Page directive

3. Any chances submit button has CausesValidation property set to false?

Hope it helps

Milosz

"Jeff" wrote:

Quote:

Originally Posted by

Hey
>
asp.net 2.0
>
I'm creating a web site where people must register to get access to
restricted area. In the CreateUserWizard control I've added a check on email
is unique (see the code below).. The problem is that this UniqueEmail method
isn't triggered when leaving the Email field or submitting the
CreateUserWizard (click on the finish button)
>
<asp:CustomValidator ID="valUniqueEmail" runat="server" ErrorMessage="Your
Email address is already taken" ControlToValidate="Email"
OnServerValidate="UniqueEmail"></asp:CustomValidator>
>
protected void UniqueEmail(object source, ServerValidateEventArgs args)
{
MembershipUserCollection allUsers = Membership.GetAllUsers();
Debug.WriteLine("UniqueEmail");
foreach (MembershipUser user in allUsers)
{
if (user.Email == args.Value)
{
Debug.WriteLine("Testing " + user.UserName + " against " +
args.Value);
args.IsValid = false;
}
}
}
>
Any suggestions?
>
Jeff
>
>
>


Thank you!

I've just manage to solve it. The markup of the CustomValidator was missing:
ValidationGroup="CreateUserWizard1"
Jeff

"Milosz Skalecki [MCAD]" <mily242@.DONTLIKESPAMwp.plwrote in message
news:504C4D4E-323A-460A-90AE-1A4CDEAD8237@.microsoft.com...

Quote:

Originally Posted by

Hi Jeff,
>
Few things:
>
1. If EnableClientValidation is set to false, when you leav the control,
validation is not preformed (value is only validated when page is posted
back). In addition to that, CustomValidator control exposes
ValidateEmptyText
property, which should be set to true if you expect empty text is
considered
as a valid value for validation.
>
2. Because you're utilizing event wire up, make sure AutoEventWireup is
set
to true in <@.Page directive
>
3. Any chances submit button has CausesValidation property set to false?
>
Hope it helps
>
Milosz
>
"Jeff" wrote:
>

Quote:

Originally Posted by

>Hey
>>
>asp.net 2.0
>>
>I'm creating a web site where people must register to get access to
>restricted area. In the CreateUserWizard control I've added a check on
>email
>is unique (see the code below).. The problem is that this UniqueEmail
>method
>isn't triggered when leaving the Email field or submitting the
>CreateUserWizard (click on the finish button)
>>
><asp:CustomValidator ID="valUniqueEmail" runat="server"
>ErrorMessage="Your
>Email address is already taken" ControlToValidate="Email"
>OnServerValidate="UniqueEmail"></asp:CustomValidator>
>>
>protected void UniqueEmail(object source, ServerValidateEventArgs args)
>{
> MembershipUserCollection allUsers = Membership.GetAllUsers();
> Debug.WriteLine("UniqueEmail");
> foreach (MembershipUser user in allUsers)
> {
> if (user.Email == args.Value)
> {
> Debug.WriteLine("Testing " + user.UserName + " against " +
>args.Value);
> args.IsValid = false;
> }
> }
>}
>>
>Any suggestions?
>>
>Jeff
>>
>>
>>

newbie: problem with master pages!

Hey
I'm creating a simple helloworld project in visual web developer 2005
express
In my my project I've created a simple master page, that contains 1 table (3
rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is placed
at row 2, column 2 (that means it's in the centre cell in the table)...
After creating the master mage, I then created a new web page that uses this
master page. In this web page I added a calendar. But my PROBLEM occur when
I run this website, the calendar is then placed a bit offset to the
left..See this link, and you see what I mean:
http://home.online.no/~au-holme/pub/66404/ (I'm using those different colors
to see where all the table cells goes) As mentioned above the
contentplaceholder is in the second row, seconds column.. but here the
contentplaceholder uses parts of column 1...
I want contentplaceholder to be in column 2, row 2, not like this (column 2
+ COLUMN 1, row 2)
What am I doing wrong here?
Maybe it's a bad idea to position contentplaceholder using tables?
Maybe Panel should be used instead for position contentplaceholder?
Best Regards
JeffLearn CSS Jeff. It solves all these problems but note if you are using
Themes or StyleSheetThemes with your MasterPage.
For now try to wrap your calendar in a div and play with the margin
values...
<div style="margin: .25em .25em .25em .25em">
<asp:Calendar ... />
</div>
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23iTacEhmGHA.3732@.TK2MSFTNGP05.phx.gbl...
> Hey
> I'm creating a simple helloworld project in visual web developer 2005
> express
> In my my project I've created a simple master page, that contains 1 table
> (3 rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is
> placed at row 2, column 2 (that means it's in the centre cell in the
> table)...
> After creating the master mage, I then created a new web page that uses
> this master page. In this web page I added a calendar. But my PROBLEM
> occur when I run this website, the calendar is then placed a bit offset to
> the left..See this link, and you see what I mean:
> http://home.online.no/~au-holme/pub/66404/ (I'm using those different
> colors to see where all the table cells goes) As mentioned above the
> contentplaceholder is in the second row, seconds column.. but here the
> contentplaceholder uses parts of column 1...
> I want contentplaceholder to be in column 2, row 2, not like this (column
> 2 + COLUMN 1, row 2)
> What am I doing wrong here?
> Maybe it's a bad idea to position contentplaceholder using tables?
> Maybe Panel should be used instead for position contentplaceholder?
> Best Regards
> Jeff
>

newbie: problem with master pages!

Hey

I'm creating a simple helloworld project in visual web developer 2005
express

In my my project I've created a simple master page, that contains 1 table (3
rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is placed
at row 2, column 2 (that means it's in the centre cell in the table)...

After creating the master mage, I then created a new web page that uses this
master page. In this web page I added a calendar. But my PROBLEM occur when
I run this website, the calendar is then placed a bit offset to the
left..See this link, and you see what I mean:
http://home.online.no/~au-holme/pub/66404/ (I'm using those different colors
to see where all the table cells goes) As mentioned above the
contentplaceholder is in the second row, seconds column.. but here the
contentplaceholder uses parts of column 1...

I want contentplaceholder to be in column 2, row 2, not like this (column 2
+ COLUMN 1, row 2)

What am I doing wrong here?

Maybe it's a bad idea to position contentplaceholder using tables?

Maybe Panel should be used instead for position contentplaceholder?

Best Regards

JeffLearn CSS Jeff. It solves all these problems but note if you are using
Themes or StyleSheetThemes with your MasterPage.

For now try to wrap your calendar in a div and play with the margin
values...

<div style="margin: .25em .25em .25em .25em">
<asp:Calendar ... />
</div
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23iTacEhmGHA.3732@.TK2MSFTNGP05.phx.gbl...
> Hey
> I'm creating a simple helloworld project in visual web developer 2005
> express
> In my my project I've created a simple master page, that contains 1 table
> (3 rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is
> placed at row 2, column 2 (that means it's in the centre cell in the
> table)...
> After creating the master mage, I then created a new web page that uses
> this master page. In this web page I added a calendar. But my PROBLEM
> occur when I run this website, the calendar is then placed a bit offset to
> the left..See this link, and you see what I mean:
> http://home.online.no/~au-holme/pub/66404/ (I'm using those different
> colors to see where all the table cells goes) As mentioned above the
> contentplaceholder is in the second row, seconds column.. but here the
> contentplaceholder uses parts of column 1...
> I want contentplaceholder to be in column 2, row 2, not like this (column
> 2 + COLUMN 1, row 2)
> What am I doing wrong here?
> Maybe it's a bad idea to position contentplaceholder using tables?
> Maybe Panel should be used instead for position contentplaceholder?
> Best Regards
> Jeff

newbie: Problem with CustomValidator

Hey
asp.net 2.0
I'm creating a web site where people must register to get access to
restricted area. In the CreateUserWizard control I've added a check on email
is unique (see the code below).. The problem is that this UniqueEmail method
isn't triggered when leaving the Email field or submitting the
CreateUserWizard (click on the finish button)
<asp:CustomValidator ID="valUniqueEmail" runat="server" ErrorMessage="Your
Email address is already taken" ControlToValidate="Email"
OnServerValidate="UniqueEmail"></asp:CustomValidator>
protected void UniqueEmail(object source, ServerValidateEventArgs args)
{
MembershipUserCollection allUsers = Membership.GetAllUsers();
Debug.WriteLine("UniqueEmail");
foreach (MembershipUser user in allUsers)
{
if (user.Email == args.Value)
{
Debug.WriteLine("Testing " + user.UserName + " against " +
args.Value);
args.IsValid = false;
}
}
}
Any suggestions?
JeffHi Jeff,
Few things:
1. If EnableClientValidation is set to false, when you leav the control,
validation is not preformed (value is only validated when page is posted
back). In addition to that, CustomValidator control exposes ValidateEmptyTex
t
property, which should be set to true if you expect empty text is considered
as a valid value for validation.
2. Because you're utilizing event wire up, make sure AutoEventWireup is set
to true in <@.Page > directive
3. Any chances submit button has CausesValidation property set to false?
Hope it helps
Milosz
"Jeff" wrote:

> Hey
> asp.net 2.0
> I'm creating a web site where people must register to get access to
> restricted area. In the CreateUserWizard control I've added a check on ema
il
> is unique (see the code below).. The problem is that this UniqueEmail meth
od
> isn't triggered when leaving the Email field or submitting the
> CreateUserWizard (click on the finish button)
> <asp:CustomValidator ID="valUniqueEmail" runat="server" ErrorMessage="Your
> Email address is already taken" ControlToValidate="Email"
> OnServerValidate="UniqueEmail"></asp:CustomValidator>
> protected void UniqueEmail(object source, ServerValidateEventArgs args)
> {
> MembershipUserCollection allUsers = Membership.GetAllUsers();
> Debug.WriteLine("UniqueEmail");
> foreach (MembershipUser user in allUsers)
> {
> if (user.Email == args.Value)
> {
> Debug.WriteLine("Testing " + user.UserName + " against " +
> args.Value);
> args.IsValid = false;
> }
> }
> }
> Any suggestions?
> Jeff
>
>
Thank you!
I've just manage to solve it. The markup of the CustomValidator was missing:
ValidationGroup="CreateUserWizard1"
Jeff
"Milosz Skalecki [MCAD]" <mily242@.DONTLIKESPAMwp.pl> wrote in message
news:504C4D4E-323A-460A-90AE-1A4CDEAD8237@.microsoft.com...
> Hi Jeff,
> Few things:
> 1. If EnableClientValidation is set to false, when you leav the control,
> validation is not preformed (value is only validated when page is posted
> back). In addition to that, CustomValidator control exposes
> ValidateEmptyText
> property, which should be set to true if you expect empty text is
> considered
> as a valid value for validation.
> 2. Because you're utilizing event wire up, make sure AutoEventWireup is
> set
> to true in <@.Page > directive
> 3. Any chances submit button has CausesValidation property set to false?
> Hope it helps
> Milosz
> "Jeff" wrote:
>

newbie: Problems creating asp.net 2.0 Menu

Hey

ASP.NET 2.0

On my web page I got 2 menu controls: menu A is a horizontal menu displaying
menuitems at the top level. Menu B displays the submenuitems related to what
is selected in menu A. Menu A and Menu B are using the same sitemap
provider.. This works fine today.

But now I want to improve this a bit:
I still want menu B to show submenuitems related to menu A.. but now I also
want it show some other submenuitems which isn't affect by what is selected
in menu A

Example:
SideMenu
Item A
Item B
Item C
SideMenu B
Item D
Item E
Item F

In the example above SideMenu is related to what select in menu A, but
SideMenu B and it's submenuitems isn't related to menu A...

Here is the content of a sitemap file from my project:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="">
<siteMapNode url="#" title="Main Menu A" description="" >
<siteMapNode url="#" title="Sub Menu 1" description="" />
<siteMapNode url="#" title="Sub Menu 2" description="" />
</siteMapNode>
<siteMapNode url="#" title="Main Menu B" description="" >
<siteMapNode url="#" title="Sub Menu 3" description="" />
<siteMapNode url="#" title="Sub Menu 4" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>

This is the menu B markup in my web page:
<asp:Menu ID="mnuHeader"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Horizontal"
StaticDisplayLevels="2"
OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
StaticMenuItemStyle-CssClass="MainMenu"
StaticHoverStyle-CssClass="MainMenu:hover" />
<asp:SiteMapDataSource ID="smdsHeader" runat="server"
SiteMapProvider="Members" />

I'm wondering about how to configure (both in .sitemap file and in markup)
these additional submenu items so they are not related to what is selected
in menu A

Best Regards

JeffLook at the bottom

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hey
>
ASP.NET 2.0
>
On my web page I got 2 menu controls: menu A is a horizontal menu
displaying menuitems at the top level. Menu B displays the submenuitems
related to what is selected in menu A. Menu A and Menu B are using the
same sitemap provider.. This works fine today.
>
But now I want to improve this a bit:
I still want menu B to show submenuitems related to menu A.. but now I
also want it show some other submenuitems which isn't affect by what is
selected in menu A
>
Example:
SideMenu
Item A
Item B
Item C
SideMenu B
Item D
Item E
Item F
>
In the example above SideMenu is related to what select in menu A, but
SideMenu B and it's submenuitems isn't related to menu A...
>
Here is the content of a sitemap file from my project:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="">
<siteMapNode url="#" title="Main Menu A" description="" >
<siteMapNode url="#" title="Sub Menu 1" description="" />
<siteMapNode url="#" title="Sub Menu 2" description="" />
</siteMapNode>
<siteMapNode url="#" title="Main Menu B" description="" >
<siteMapNode url="#" title="Sub Menu 3" description="" />
<siteMapNode url="#" title="Sub Menu 4" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>
>
This is the menu B markup in my web page:
<asp:Menu ID="mnuHeader"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Horizontal"
StaticDisplayLevels="2"
OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
StaticMenuItemStyle-CssClass="MainMenu"
StaticHoverStyle-CssClass="MainMenu:hover" />
<asp:SiteMapDataSource ID="smdsHeader" runat="server"
SiteMapProvider="Members" />
>
I'm wondering about how to configure (both in .sitemap file and in markup)
these additional submenu items so they are not related to what is selected
in menu A
>
Best Regards
>
Jeff
>


the menu markup I posted in my previous post is NOT for menu B it is for
menu A

Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>

I still wondering how to solve this

Jeff
I've solved this by using 2 menu controls

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OP2bkFfTHHA.996@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Look at the bottom
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>Hey
>>
>ASP.NET 2.0
>>
>On my web page I got 2 menu controls: menu A is a horizontal menu
>displaying menuitems at the top level. Menu B displays the submenuitems
>related to what is selected in menu A. Menu A and Menu B are using the
>same sitemap provider.. This works fine today.
>>
>But now I want to improve this a bit:
>I still want menu B to show submenuitems related to menu A.. but now I
>also want it show some other submenuitems which isn't affect by what is
>selected in menu A
>>
>Example:
>SideMenu
> Item A
> Item B
> Item C
>SideMenu B
> Item D
> Item E
> Item F
>>
>In the example above SideMenu is related to what select in menu A, but
>SideMenu B and it's submenuitems isn't related to menu A...
>>
>Here is the content of a sitemap file from my project:
><?xml version="1.0" encoding="utf-8" ?>
><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
> <siteMapNode url="Default.aspx" title="Home" description="">
> <siteMapNode url="#" title="Main Menu A" description="" >
> <siteMapNode url="#" title="Sub Menu 1" description="" />
> <siteMapNode url="#" title="Sub Menu 2" description="" />
> </siteMapNode>
> <siteMapNode url="#" title="Main Menu B" description="" >
> <siteMapNode url="#" title="Sub Menu 3" description="" />
> <siteMapNode url="#" title="Sub Menu 4" description="" />
> </siteMapNode>
> </siteMapNode>
></siteMap>
>>
>This is the menu B markup in my web page:
><asp:Menu ID="mnuHeader"
> runat="server"
> DataSourceID="smdsHeader"
> MaximumDynamicDisplayLevels="0"
> Orientation="Horizontal"
> StaticDisplayLevels="2"
> OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
> StaticMenuItemStyle-CssClass="MainMenu"
> StaticHoverStyle-CssClass="MainMenu:hover" />
><asp:SiteMapDataSource ID="smdsHeader" runat="server"
>SiteMapProvider="Members" />
>>
>I'm wondering about how to configure (both in .sitemap file and in
>markup) these additional submenu items so they are not related to what is
>selected in menu A
>>
>Best Regards
>>
>Jeff
>>


>
the menu markup I posted in my previous post is NOT for menu B it is for
menu A
>
Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>
>
I still wondering how to solve this
>
Jeff
>


I didn't find a solution so I had to use a workaround. Using 2 menu controls
instead of only 1

So I consider this thread for solved

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OP2bkFfTHHA.996@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Look at the bottom
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>Hey
>>
>ASP.NET 2.0
>>
>On my web page I got 2 menu controls: menu A is a horizontal menu
>displaying menuitems at the top level. Menu B displays the submenuitems
>related to what is selected in menu A. Menu A and Menu B are using the
>same sitemap provider.. This works fine today.
>>
>But now I want to improve this a bit:
>I still want menu B to show submenuitems related to menu A.. but now I
>also want it show some other submenuitems which isn't affect by what is
>selected in menu A
>>
>Example:
>SideMenu
> Item A
> Item B
> Item C
>SideMenu B
> Item D
> Item E
> Item F
>>
>In the example above SideMenu is related to what select in menu A, but
>SideMenu B and it's submenuitems isn't related to menu A...
>>
>Here is the content of a sitemap file from my project:
><?xml version="1.0" encoding="utf-8" ?>
><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
> <siteMapNode url="Default.aspx" title="Home" description="">
> <siteMapNode url="#" title="Main Menu A" description="" >
> <siteMapNode url="#" title="Sub Menu 1" description="" />
> <siteMapNode url="#" title="Sub Menu 2" description="" />
> </siteMapNode>
> <siteMapNode url="#" title="Main Menu B" description="" >
> <siteMapNode url="#" title="Sub Menu 3" description="" />
> <siteMapNode url="#" title="Sub Menu 4" description="" />
> </siteMapNode>
> </siteMapNode>
></siteMap>
>>
>This is the menu B markup in my web page:
><asp:Menu ID="mnuHeader"
> runat="server"
> DataSourceID="smdsHeader"
> MaximumDynamicDisplayLevels="0"
> Orientation="Horizontal"
> StaticDisplayLevels="2"
> OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
> StaticMenuItemStyle-CssClass="MainMenu"
> StaticHoverStyle-CssClass="MainMenu:hover" />
><asp:SiteMapDataSource ID="smdsHeader" runat="server"
>SiteMapProvider="Members" />
>>
>I'm wondering about how to configure (both in .sitemap file and in
>markup) these additional submenu items so they are not related to what is
>selected in menu A
>>
>Best Regards
>>
>Jeff
>>


>
the menu markup I posted in my previous post is NOT for menu B it is for
menu A
>
Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>
>
I still wondering how to solve this
>
Jeff
>

Thursday, March 22, 2012

newbie??

Greetings All
I'm new to this forum and the asp.net enviroment...so execuse the nub questions.........Heres my question....I am creating a form where you input various information...on one part you input your personal information (first name , last name , etc ) ...with an add button ...I'm trying to get the information to display in a textarea(html control) when you click add. Every time you click add it jumps to the next line in the textarea and print the new information......I'm not sure if textarea is the bext tool to use.....and i can't seem to get anything displayed in the text area any help is greatly appreciated....So, you have a bunch of text boxes for collecting user information, a button, and a multiline text box?
Do you have any plans to persist the data, like in session state or a database? Or you just want to concatenate all of the fields into one string with each field taking up one line -- and you want that string inserted into a multiline textbox upon pressing the button on your page?

Correct, I have multiply text box for user to enter information and and multiply buttons for add, delete, search etc...I am also going to stored the information in a sql database.....I am trying to set up a multiline text box to display the information that was entered so the user can see what they have entered ...i am trying to use the html text area to display the information but i am having trouble with using the text area....is there a better type of multiline text box i can use other than a text area?


can anyone help?
I think it is a wise idea to take a look at the possible solution to use a datagrid. It is a little bit more work. But it looks better and is in the long run easier to maintain (if your design is right)
This is totaly depending what are you gone use it for.
Hello,
Why not using text box server control?
Textbox1.text &= txtfirstname.text & " " & txtlastname.text
is that what you need?
HTH
regards

thanks for all the help.....i decided to use the a data grid......the textbox idea was great but i need it to display the user information in seperate lines.........again thanks for the help..
hello
I'm back again...well i was using the dataview for displaying user input.....the new problem is that i need a text area or what ever is better to display user information with out saving it to the database ......theres other information that needs to be completed before it can be saved to the database............the layout --> the page is in 2 parts -- part 1 is user infor, part 2 is a survey information, all information is added to the DB at the end of the form ....I am trying to set up a textarea so that when the user click add at part 1 he can see the names that is going to be added to the db if he made a mistake he can delete it......after user infor is added the user then proceed to part 2 of the form after he completes the form he can add all info to the DB... any help willl be greatly appreciated
is there a way i can bind textbox to the dataview colums...

My new solution is to us a textbox and set the multi line option on ..here is an example of my new problem --> ex: i have created 3 text box , 1 being the text box with multiline to act as a text area. I also added an submit button so user can click the button and display what they have inputed into the other 2 text box...my problem is how can i get the text area to go to the next line every time a user click submit.....ex: textbox 1 =id lastname ; textboxt 2 = id fisrtname ; textbox 3 =id text area.....and button id = submit...any help is greatly appreiciated

Friday, March 16, 2012

NewPageIndex Doesn't Get Updated in PageIndexChanging Event

We have a base class that is responsible for creating the navigation and loo
k
and feel of our applications. So all our web pages inherit from this base
page so they don't have to worry about the look and feel and navigation, onl
y
the main content. Everything has woked just fine until we converted to 2.0.
Now we have a problem with the new GridView and the paging. With the
DataGrid in 1.1, the paging worked just fine. Now with paging turned on and
the mode set to "NextPrevious" the NewPageIndex doesn't get updated in the
PageIndexChanging event. However if I change the web page to not inherit
from my base class but just from the System.web.ui.page then the paging work
s
correctly. This is a code snipit of our base class and how it loads the
controls from the derived page. I am really stumped on this one so if anyon
e
has any ideas it would be greatly appreciated.
ASPX Page:
<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<asp:GridView ID="GridView1" runat="server" AllowPaging="true"
OnPageIndexChanging="GridView1_PageIndexChanging">
<PagerSettings Mode="NextPrevious"></PagerSettings>
</asp:GridView>
Code Behind (scaled down and only showing the basics):
using System;
using System.Data;
using System.Configuration;
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;
using System.Data.OleDb;
public partial class _Default : MyBasePage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
GridView1.DataSource = GetDataSource();
GridView1.DataBind();
}
}
protected void GridView1_PageIndexChanging(object sender,
GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataSource = GetDataSource();
GridView1.DataBind();
}
private DataSet GetDataSource()
{
OleDbConnection cn = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=C:\\Program Files\\Microsoft Visual Studio\\VB98\\nwind.mdb");
OleDbDataAdapter da = new OleDbDataAdapter("Select CompanyName,
ContactName, Address from Customers", cn);
DataSet customers = new DataSet();
da.Fill(customers, "Customers");
return customers;
}
}
public class MyBasePage : System.Web.UI.Page
{
HtmlForm objForm;
public MyBasePage()
{
objForm = new HtmlForm();
}
protected override void OnInit(System.EventArgs e)
{
BuildPage();
base.OnInit(e);
}
private void BuildPage()
{
for (int i = 0; i < this.Controls.Count; i++)
{
System.Web.UI.Control objCtrl = this.Controls[0];
objForm.Controls.Add(objCtrl);
this.Controls.Remove(objCtrl);
}
this.Controls.Add(objForm);
}
}Hi,
Thank you for your post.
First, this problem can be fixed by using following BuildPage() function:
private void BuildPage()
{
ArrayList al = new ArrayList();
foreach(Control c in Controls)
{
al.Add(c);
}
Controls.Add(objForm);
foreach(Control c in al)
{
objForm.Controls.Add(c);
}
}
Following are detailed causes:
1) The root cause of this problem is GridView's PageIndex is stored using
ASP.NET 2.0's new feature called "ControlState". See following MSDN for
more info:
http://msdn2.microsoft.com/en-us/li...atepersister.co
ntrolstate.aspx
A server control that use control state must call the
RegisterRequiresControlState method on each request because registration
for control state is not carried over from request to request during a
postback event. It is recommended that registration occur in the Init event.
GridView calls this method in its OnInit:
protected internal override void OnInit(EventArgs e)
{
base.OnInit(e);
if (this.Page != null)
{
if ((this.DataKeyNames.Length > 0) &&
!this.AutoGenerateColumns)
{
this.Page.RegisterRequiresViewStateEncryption();
}
this.Page.RegisterRequiresControlState(this);
}
}
Please note that it checks for "this.Page != null" first.
2) When adding a control to a ControlCollection, it will automatically
first remove it from its old parent.Controls (if its parent is not null),
and removing a control will Unload it first!
In previous code, when we first add the GridView to objForm.Controls,
because objForm is not added to Page.Controls yet, the "this.Page != null"
will be false for the GridView, thus not calling the
RegisterRequiresControlState.
So, what we are doing now is first adding the objForm to Page.Controls,
then add the remaining controls to objForm, this will ensure GridView's
ControlState is persisted.
As a side note, in ASP.NET 2.0, we have a new feature called MasterPage
which is exactly for the purpose of keeping a consistent look and feel for
the entire website.
Hope this helps. Please feel free to post here if anything is unclear.
Regards,
Walter Wang
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Walter, thanks for the reply. That fixed it. However, this brings up
another question. We currently use this base page for our 1.1 apps. We hav
e
some groups in our company that are trying to use our base page compiled wit
h
1.1 in their 2.0 web apps. This is the first issue we have ran into with
trying to use our 1.1 base code in a 2.0 app. If I go change our base page
to load the form into the page object before I load any controls into the
form collection, will this cause any problems with any of the 1.1 controls?
Also, in response to your side note, I wanted to use the Master pages but
unfortunately our base page is in a class library in a seperate assembly
rather than in the web application itself so there was no way to use the
master pages. At least this is what Microsoft told us. We distribute this
assembly throughout our company to let other development teams use in order
to have the corporate look and feel.
"Walter Wang [MSFT]" wrote:

> Hi,
> Thank you for your post.
> First, this problem can be fixed by using following BuildPage() function:
> private void BuildPage()
> {
> ArrayList al = new ArrayList();
> foreach(Control c in Controls)
> {
> al.Add(c);
> }
> Controls.Add(objForm);
> foreach(Control c in al)
> {
> objForm.Controls.Add(c);
> }
> }
> Following are detailed causes:
> 1) The root cause of this problem is GridView's PageIndex is stored using
> ASP.NET 2.0's new feature called "ControlState". See following MSDN for
> more info:
> [url]http://msdn2.microsoft.com/en-us/library/system.web.ui.pagestatepersister.co[/ur
l]
> ntrolstate.aspx
> A server control that use control state must call the
> RegisterRequiresControlState method on each request because registration
> for control state is not carried over from request to request during a
> postback event. It is recommended that registration occur in the Init even
t.
> GridView calls this method in its OnInit:
> protected internal override void OnInit(EventArgs e)
> {
> base.OnInit(e);
> if (this.Page != null)
> {
> if ((this.DataKeyNames.Length > 0) &&
> !this.AutoGenerateColumns)
> {
> this.Page.RegisterRequiresViewStateEncryption();
> }
> this.Page.RegisterRequiresControlState(this);
> }
> }
> Please note that it checks for "this.Page != null" first.
> 2) When adding a control to a ControlCollection, it will automatically
> first remove it from its old parent.Controls (if its parent is not null),
> and removing a control will Unload it first!
> In previous code, when we first add the GridView to objForm.Controls,
> because objForm is not added to Page.Controls yet, the "this.Page != null"
> will be false for the GridView, thus not calling the
> RegisterRequiresControlState.
> So, what we are doing now is first adding the objForm to Page.Controls,
> then add the remaining controls to objForm, this will ensure GridView's
> ControlState is persisted.
> As a side note, in ASP.NET 2.0, we have a new feature called MasterPage
> which is exactly for the purpose of keeping a consistent look and feel for
> the entire website.
> Hope this helps. Please feel free to post here if anything is unclear.
> Regards,
> Walter Wang
> Microsoft Online Community Support
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>

NewPageIndex Doesnt Get Updated in PageIndexChanging Event

We have a base class that is responsible for creating the navigation and look
and feel of our applications. So all our web pages inherit from this base
page so they don't have to worry about the look and feel and navigation, only
the main content. Everything has woked just fine until we converted to 2.0.
Now we have a problem with the new GridView and the paging. With the
DataGrid in 1.1, the paging worked just fine. Now with paging turned on and
the mode set to "NextPrevious" the NewPageIndex doesn't get updated in the
PageIndexChanging event. However if I change the web page to not inherit
from my base class but just from the System.web.ui.page then the paging works
correctly. This is a code snipit of our base class and how it loads the
controls from the derived page. I am really stumped on this one so if anyone
has any ideas it would be greatly appreciated.

ASPX Page:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<asp:GridView ID="GridView1" runat="server" AllowPaging="true"
OnPageIndexChanging="GridView1_PageIndexChanging">
<PagerSettings Mode="NextPrevious"></PagerSettings>
</asp:GridView
Code Behind (scaled down and only showing the basics):

using System;
using System.Data;
using System.Configuration;
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;
using System.Data.OleDb;

public partial class _Default : MyBasePage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
GridView1.DataSource = GetDataSource();
GridView1.DataBind();
}
}

protected void GridView1_PageIndexChanging(object sender,
GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataSource = GetDataSource();
GridView1.DataBind();
}

private DataSet GetDataSource()
{
OleDbConnection cn = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=C:\\Program Files\\Microsoft Visual Studio\\VB98\\nwind.mdb");
OleDbDataAdapter da = new OleDbDataAdapter("Select CompanyName,
ContactName, Address from Customers", cn);
DataSet customers = new DataSet();
da.Fill(customers, "Customers");
return customers;
}
}

public class MyBasePage : System.Web.UI.Page
{
HtmlForm objForm;

public MyBasePage()
{
objForm = new HtmlForm();
}

protected override void OnInit(System.EventArgs e)
{
BuildPage();
base.OnInit(e);
}

private void BuildPage()
{
for (int i = 0; i < this.Controls.Count; i++)
{
System.Web.UI.Control objCtrl = this.Controls[0];
objForm.Controls.Add(objCtrl);
this.Controls.Remove(objCtrl);
}
this.Controls.Add(objForm);
}
}Hi,

Thank you for your post.

First, this problem can be fixed by using following BuildPage() function:

private void BuildPage()
{
ArrayList al = new ArrayList();
foreach(Control c in Controls)
{
al.Add(c);
}
Controls.Add(objForm);

foreach(Control c in al)
{
objForm.Controls.Add(c);
}
}

Following are detailed causes:

1) The root cause of this problem is GridView's PageIndex is stored using
ASP.NET 2.0's new feature called "ControlState". See following MSDN for
more info:
http://msdn2.microsoft.com/en-us/li...atepersister.co
ntrolstate.aspx

A server control that use control state must call the
RegisterRequiresControlState method on each request because registration
for control state is not carried over from request to request during a
postback event. It is recommended that registration occur in the Init event.

GridView calls this method in its OnInit:

protected internal override void OnInit(EventArgs e)
{
base.OnInit(e);
if (this.Page != null)
{
if ((this.DataKeyNames.Length > 0) &&
!this.AutoGenerateColumns)
{
this.Page.RegisterRequiresViewStateEncryption();
}
this.Page.RegisterRequiresControlState(this);
}
}

Please note that it checks for "this.Page != null" first.

2) When adding a control to a ControlCollection, it will automatically
first remove it from its old parent.Controls (if its parent is not null),
and removing a control will Unload it first!

In previous code, when we first add the GridView to objForm.Controls,
because objForm is not added to Page.Controls yet, the "this.Page != null"
will be false for the GridView, thus not calling the
RegisterRequiresControlState.

So, what we are doing now is first adding the objForm to Page.Controls,
then add the remaining controls to objForm, this will ensure GridView's
ControlState is persisted.

As a side note, in ASP.NET 2.0, we have a new feature called MasterPage
which is exactly for the purpose of keeping a consistent look and feel for
the entire website.

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Walter, thanks for the reply. That fixed it. However, this brings up
another question. We currently use this base page for our 1.1 apps. We have
some groups in our company that are trying to use our base page compiled with
1.1 in their 2.0 web apps. This is the first issue we have ran into with
trying to use our 1.1 base code in a 2.0 app. If I go change our base page
to load the form into the page object before I load any controls into the
form collection, will this cause any problems with any of the 1.1 controls?

Also, in response to your side note, I wanted to use the Master pages but
unfortunately our base page is in a class library in a seperate assembly
rather than in the web application itself so there was no way to use the
master pages. At least this is what Microsoft told us. We distribute this
assembly throughout our company to let other development teams use in order
to have the corporate look and feel.

"Walter Wang [MSFT]" wrote:

> Hi,
> Thank you for your post.
> First, this problem can be fixed by using following BuildPage() function:
> private void BuildPage()
> {
> ArrayList al = new ArrayList();
> foreach(Control c in Controls)
> {
> al.Add(c);
> }
> Controls.Add(objForm);
> foreach(Control c in al)
> {
> objForm.Controls.Add(c);
> }
> }
> Following are detailed causes:
> 1) The root cause of this problem is GridView's PageIndex is stored using
> ASP.NET 2.0's new feature called "ControlState". See following MSDN for
> more info:
> http://msdn2.microsoft.com/en-us/li...atepersister.co
> ntrolstate.aspx
> A server control that use control state must call the
> RegisterRequiresControlState method on each request because registration
> for control state is not carried over from request to request during a
> postback event. It is recommended that registration occur in the Init event.
> GridView calls this method in its OnInit:
> protected internal override void OnInit(EventArgs e)
> {
> base.OnInit(e);
> if (this.Page != null)
> {
> if ((this.DataKeyNames.Length > 0) &&
> !this.AutoGenerateColumns)
> {
> this.Page.RegisterRequiresViewStateEncryption();
> }
> this.Page.RegisterRequiresControlState(this);
> }
> }
> Please note that it checks for "this.Page != null" first.
> 2) When adding a control to a ControlCollection, it will automatically
> first remove it from its old parent.Controls (if its parent is not null),
> and removing a control will Unload it first!
> In previous code, when we first add the GridView to objForm.Controls,
> because objForm is not added to Page.Controls yet, the "this.Page != null"
> will be false for the GridView, thus not calling the
> RegisterRequiresControlState.
> So, what we are doing now is first adding the objForm to Page.Controls,
> then add the remaining controls to objForm, this will ensure GridView's
> ControlState is persisted.
> As a side note, in ASP.NET 2.0, we have a new feature called MasterPage
> which is exactly for the purpose of keeping a consistent look and feel for
> the entire website.
> Hope this helps. Please feel free to post here if anything is unclear.
> Regards,
> Walter Wang
> Microsoft Online Community Support
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
Hi,

Thank you for your update and I'm glad that the suggestion worked.

Based on my research, adding an HtmlForm instance first is the preferred
way to mimic a normal ASP.NET page, since Control.Page property will use
parent to find the Page reference. If you add controls to HtmlForm first,
their Page reference are null and you don't know if they will check this
reference in OnInit or not. In a word, this "advanced" Page inheritance
technique is not officially supported so we have to test to see if it
really works.

As for the MasterPage issue, unfortunately it does need the *.master source
to be distributed.

Please feel free to post here if there's anything I can help.

Regards,
Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

News content to XML file

Hello,
I have been given a task for creating a utility (asp.net/vb.net) exe which
transaltes the news content
into an XML file.

Can some one give me any directions to how we need to do this?

ThanksWhy not consider syndicating your news as an RSS xml file. It will then at
least be in a format and structure easily deciphered.

http://aspnet.4guysfromrolla.com/articles/021804-1.aspx

--
Regards

John Timney (MVP)

"Karthik Natarajan" <nkarthik04@.gmail.com> wrote in message
news:Ok1N4qYkGHA.3816@.TK2MSFTNGP02.phx.gbl...
> Hello,
> I have been given a task for creating a utility (asp.net/vb.net) exe which
> transaltes the news content
> into an XML file.
> Can some one give me any directions to how we need to do this?
>
> Thanks
>

News Scroller

I need a little help getting started creating a news scroller for my site. I currently have a java applet scroller www.autokiller.com. I would like to write one in ASP.NET. I know VB.NET and a little C++. I wrote all the code needed for the scroller in a windows control, I just need help converting to a web control.Hi,

Take a look @.ASP.NET Custom Controls - Client-Side Script Generation

HTH

Newsletter application

I need help on creating newsletter application which creates database with name and emailaddress and sends out newsletter every month using asp.net 2.0. I need to know how to create and send news letter?

What part are you stuck on? To tell you how to program a newsletter application would take a small book. Have you looked at existing products?

Jeff


So far I only know to create front end so that user can enter their email address and subscribe or unsubscribe.

I want to know how to create Newsletter (with html, dhtml, javascript...etc very dynamic newsletter) and email every month. (this part I dont understand). There are third party products available but them might be using asp.net or some other program, I want to try myself.

can you please guide me from here?


I would suggest using the FreeTextBox control (rich, HTML type textbox), for entering your newsletter information, which is available here:
http://freetextbox.com

Then, checkout this tutorial atASPNet101.com:
http://aspnet101.com/aspnet101/tutorials.aspx?id=41


I am able to send multiple email with plain text but when I try to attach colors, pictures, formatting etc it's not working form me.

is it possible to create newsletter in Frontpage or Flash etc and attach as part of email (not as attachment). or some other better way.

I looked into free text control but I still need to figure out how to make that work.


What part isnt working, and have you made sure and used the isbodyhtml = true in your code creating the message, that is an important step.

Colors, fonts, solid tables ect are easy if you can get your email to send in html. Images are a bit different, you can either hard link them to an external server, like <img src=http://myserver.com/image.jpg /> or you need to embed the image into the email itself, much like outlook or outlook express does it Fire up OE and look at the source to a message that has an embeded picture (not an attached one).


how can I embed a HTML page created in Frontpage , flash etc as newsletter to multiple addresses?


Save to a file and attach it or copy the rendered HTML and paste it into the message. Neither are a good way to send HTML email though.

Jeff


what other options I have to make it work better? I dont want to buy any third party product. An good example will help me understand better.

Define better...your asking very general questions. Do you need help creating an html email through code? Do you have an error your getting when you try to send an email through your server using asp.net?

Do you not know how to write HTML, so that you can paste it into a mail message?

Try this...This just gets the body of the message from a text / html file. I copied an IBM newsletter that I had gotten in an email, to a textfile in my solution called...textfile.txt...original huh.

Imports

System.Net.Mail

Imports

System.IOProtectedSub DoEmail()Dim msgAsString = ReadTextFile()Dim myClientAsNew SmtpClientDim myMessageAsNew MailMessageTry

myMessage.From =

New MailAddress("email@.email.com")

myMessage.To.Add(

"to@.email.com")

myMessage.Subject =

"My Subject"

myMessage.IsBodyHtml =

True

myMessage.Body = msg

myClient.Host =

"mailserver"

myClient.Port = 25

myClient.Send(myMessage)

Catch exAs Exception

Response.Write(ex.ToString)

EndTry

EndSubProtectedFunction ReadTextFile()AsStringDim myFileAsString = Server.MapPath("textfile.txt")Dim SRAs StreamReaderTry

SR = File.OpenText(myFile)

ReadTextFile = SR.ReadToEnd()

Catch exAs Exception

ReadTextFile = ex.ToString

Finally

SR.Close()

EndTryEndFunction


I got almost 90% working. Some how my CSS stlyesheet are not working when send via email.

Include your styles in the HTML, not as separate files.

Jeff


They are included inside html.

Internall user dont see CSS effect in theri outlook but I tried to send it to my yahoo mail and it worked fine. how can i make that work for outlook users?


is your CSS an external link?
remember that viewing HTML mail is an option that can be turned off ( I have it turned off in my outlook express)
it would probably help to see some code...

It would also help to see the rendered source of a message from your outlook, so we can determine if it's not getting there the way it should.

From inside outlook, open the message (not in your preview pane) and then right click somewhere inside the message body and choose "View Source"

Copy and paste a short version of the mail message your trying to send.