Showing posts with label aspx. Show all posts
Showing posts with label aspx. Show all posts

Saturday, March 24, 2012

Strong name a ASPX web Page Question

Hello,
Can anyone tell me how to strong name a web page?
Thanks
GopalBuck, Rock, and Dirk are all traditionally considered strong names. ;-)
Seriously, though, a page cannot have a strong name. An assembly can.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Gopal Krish" <gsgk@.yahoo.com> wrote in message
news:8b4092e6.0411041121.7cdcfe25@.posting.google.com...
> Hello,
> Can anyone tell me how to strong name a web page?
> Thanks
> Gopal
Thanks Kevin,
Then my question is how to strong name an assembly that contains aspx
web page(s). I understand the runtime creates a assembly of the aspx
pages just before executing it.
Can I strong name that somehow?
The reason I ask this is strong names are really valuable to protect
code from hacking attempt but I can't use SecurityAction.Demand in my
class libraries because I could not strong name my ASPX pages (They do
full stack walk).
I know I can use LinkDemand or Assert but I also know they are less
secure than Demand / full stack walk.
SO, is there any way to strong name a ASPX assembly?
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
You can give a strong name to ANY .Net assembly. Here's how:
http://msdn.microsoft.com/library/d...ystrongname.asp
I'm not sure what you mean by "an assembly that contains aspx web page(s)."
Only classes are in an assembly. The Template files are not.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Gopal Krish" <gsgk@.yahoo.com> wrote in message
news:uYvdhhtwEHA.2568@.TK2MSFTNGP11.phx.gbl...
> Thanks Kevin,
> Then my question is how to strong name an assembly that contains aspx
> web page(s). I understand the runtime creates a assembly of the aspx
> pages just before executing it.
> Can I strong name that somehow?
> The reason I ask this is strong names are really valuable to protect
> code from hacking attempt but I can't use SecurityAction.Demand in my
> class libraries because I could not strong name my ASPX pages (They do
> full stack walk).
> I know I can use LinkDemand or Assert but I also know they are less
> secure than Demand / full stack walk.
> SO, is there any way to strong name a ASPX assembly?
>
>
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
Interesting question!
Do you want to strong name the temporary assemblies the runtime
creates when it parses and compiles ASPX pages?
I can't think of a way to do this.
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 04 Nov 2004 17:40:06 -0800, Gopal Krish <gsgk@.yahoo.com>
wrote:

>Thanks Kevin,
>Then my question is how to strong name an assembly that contains aspx
>web page(s). I understand the runtime creates a assembly of the aspx
>pages just before executing it.
>Can I strong name that somehow?
>The reason I ask this is strong names are really valuable to protect
>code from hacking attempt but I can't use SecurityAction.Demand in my
>class libraries because I could not strong name my ASPX pages (They do
>full stack walk).
>I know I can use LinkDemand or Assert but I also know they are less
>secure than Demand / full stack walk.
>SO, is there any way to strong name a ASPX assembly?
>
>
>
>*** Sent via Developersdex http://www.examnotes.net ***
>Don't just participate in USENET...get rewarded for it!
I couldn't answer that question, Gopal.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Gopal Krish" <gsgk@.yahoo.com> wrote in message
news:uYvdhhtwEHA.2568@.TK2MSFTNGP11.phx.gbl...
> Thanks Kevin,
> Then my question is how to strong name an assembly that contains aspx
> web page(s). I understand the runtime creates a assembly of the aspx
> pages just before executing it.
> Can I strong name that somehow?
> The reason I ask this is strong names are really valuable to protect
> code from hacking attempt but I can't use SecurityAction.Demand in my
> class libraries because I could not strong name my ASPX pages (They do
> full stack walk).
> I know I can use LinkDemand or Assert but I also know they are less
> secure than Demand / full stack walk.
> SO, is there any way to strong name a ASPX assembly?
>
>
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!

Strong name a ASPX web Page Question

Hello,

Can anyone tell me how to strong name a web page?

Thanks
GopalBuck, Rock, and Dirk are all traditionally considered strong names. ;-)

Seriously, though, a page cannot have a strong name. An assembly can.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Gopal Krish" <geeksgk@.yahoo.com> wrote in message
news:8b4092e6.0411041121.7cdcfe25@.posting.google.c om...
> Hello,
> Can anyone tell me how to strong name a web page?
> Thanks
> Gopal
Thanks Kevin,

Then my question is how to strong name an assembly that contains aspx
web page(s). I understand the runtime creates a assembly of the aspx
pages just before executing it.

Can I strong name that somehow?

The reason I ask this is strong names are really valuable to protect
code from hacking attempt but I can't use SecurityAction.Demand in my
class libraries because I could not strong name my ASPX pages (They do
full stack walk).

I know I can use LinkDemand or Assert but I also know they are less
secure than Demand / full stack walk.

SO, is there any way to strong name a ASPX assembly?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
You can give a strong name to ANY .Net assembly. Here's how:

http://msdn.microsoft.com/library/d...ystrongname.asp

I'm not sure what you mean by "an assembly that contains aspx web page(s)."
Only classes are in an assembly. The Template files are not.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Gopal Krish" <geeksgk@.yahoo.com> wrote in message
news:uYvdhhtwEHA.2568@.TK2MSFTNGP11.phx.gbl...
> Thanks Kevin,
> Then my question is how to strong name an assembly that contains aspx
> web page(s). I understand the runtime creates a assembly of the aspx
> pages just before executing it.
> Can I strong name that somehow?
> The reason I ask this is strong names are really valuable to protect
> code from hacking attempt but I can't use SecurityAction.Demand in my
> class libraries because I could not strong name my ASPX pages (They do
> full stack walk).
> I know I can use LinkDemand or Assert but I also know they are less
> secure than Demand / full stack walk.
> SO, is there any way to strong name a ASPX assembly?
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Interesting question!

Do you want to strong name the temporary assemblies the runtime
creates when it parses and compiles ASPX pages?

I can't think of a way to do this.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 04 Nov 2004 17:40:06 -0800, Gopal Krish <geeksgk@.yahoo.com>
wrote:

>Thanks Kevin,
>Then my question is how to strong name an assembly that contains aspx
>web page(s). I understand the runtime creates a assembly of the aspx
>pages just before executing it.
>Can I strong name that somehow?
>The reason I ask this is strong names are really valuable to protect
>code from hacking attempt but I can't use SecurityAction.Demand in my
>class libraries because I could not strong name my ASPX pages (They do
>full stack walk).
>I know I can use LinkDemand or Assert but I also know they are less
>secure than Demand / full stack walk.
>SO, is there any way to strong name a ASPX assembly?
>
>
>
>*** Sent via Developersdex http://www.developersdex.com ***
>Don't just participate in USENET...get rewarded for it!
I couldn't answer that question, Gopal.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Gopal Krish" <geeksgk@.yahoo.com> wrote in message
news:uYvdhhtwEHA.2568@.TK2MSFTNGP11.phx.gbl...
> Thanks Kevin,
> Then my question is how to strong name an assembly that contains aspx
> web page(s). I understand the runtime creates a assembly of the aspx
> pages just before executing it.
> Can I strong name that somehow?
> The reason I ask this is strong names are really valuable to protect
> code from hacking attempt but I can't use SecurityAction.Demand in my
> class libraries because I could not strong name my ASPX pages (They do
> full stack walk).
> I know I can use LinkDemand or Assert but I also know they are less
> secure than Demand / full stack walk.
> SO, is there any way to strong name a ASPX assembly?
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Strong naming assembly in an vb aspx project

I put my StrongNameKey.snk in my root foler.
in my assemblyinfo.vb I have:
<Assembly: AssemblyKeyFileAttribute("StrongNameKey.snk")>
I get the error "Error creating assembly manifest: Error reading key
file 'StrongNameKey.snk' -- The system cannot find the file
specified."
?
/MHi,
The placement of key depends on what mode are you compiling your vb project
with i.e. Debug or Release.
This is a VB issue cause the build directory for VB.NET assemblies is not
the same as the output directory, which usually is \bin (relative to the
project). If the solution configuration is in the default Debug mode, the
output directory is \obj\Debug. If in Release mode, it's \obj\Release. This
is where the strong
name key file must be placed.
HTH,
Piyush
<job@.bla.com> wrote in message
news:2hkd12t1gb8ic7v3tsmrc2eehdou99okpq@.
4ax.com...
> I put my StrongNameKey.snk in my root foler.
> in my assemblyinfo.vb I have:
> <Assembly: AssemblyKeyFileAttribute("StrongNameKey.snk")>
> I get the error "Error creating assembly manifest: Error reading key
> file 'StrongNameKey.snk' -- The system cannot find the file
> specified."
> ?
> /M
Hmm. my project is a web project and I only have a bin output folder.
Even in my unittest class project in the same solution, I have the
same error. Strange.
On Tue, 14 Mar 2006 10:07:02 -0500, "Piyush Daiya"
<pdaiya@.primeassociates.com> wrote:

>Hi,
>The placement of key depends on what mode are you compiling your vb project
>with i.e. Debug or Release.
>This is a VB issue cause the build directory for VB.NET assemblies is not
>the same as the output directory, which usually is \bin (relative to the
>project). If the solution configuration is in the default Debug mode, the
>output directory is \obj\Debug. If in Release mode, it's \obj\Release. Thi
s
>is where the strong
>name key file must be placed.
>HTH,
>Piyush
><job@.bla.com> wrote in message
> news:2hkd12t1gb8ic7v3tsmrc2eehdou99okpq@.
4ax.com...
>

Strong naming assembly in an vb aspx project

I put my StrongNameKey.snk in my root foler.

in my assemblyinfo.vb I have:
<Assembly: AssemblyKeyFileAttribute("StrongNameKey.snk")
I get the error "Error creating assembly manifest: Error reading key
file 'StrongNameKey.snk' -- The system cannot find the file
specified."

?

/MHi,

The placement of key depends on what mode are you compiling your vb project
with i.e. Debug or Release.
This is a VB issue cause the build directory for VB.NET assemblies is not
the same as the output directory, which usually is \bin (relative to the
project). If the solution configuration is in the default Debug mode, the
output directory is \obj\Debug. If in Release mode, it's \obj\Release. This
is where the strong
name key file must be placed.

HTH,

Piyush
<job@.bla.com> wrote in message
news:2hkd12t1gb8ic7v3tsmrc2eehdou99okpq@.4ax.com...
> I put my StrongNameKey.snk in my root foler.
> in my assemblyinfo.vb I have:
> <Assembly: AssemblyKeyFileAttribute("StrongNameKey.snk")>
> I get the error "Error creating assembly manifest: Error reading key
> file 'StrongNameKey.snk' -- The system cannot find the file
> specified."
> ?
> /M
Hmm. my project is a web project and I only have a bin output folder.
Even in my unittest class project in the same solution, I have the
same error. Strange.

On Tue, 14 Mar 2006 10:07:02 -0500, "Piyush Daiya"
<pdaiya@.primeassociates.com> wrote:

>Hi,
>The placement of key depends on what mode are you compiling your vb project
>with i.e. Debug or Release.
>This is a VB issue cause the build directory for VB.NET assemblies is not
>the same as the output directory, which usually is \bin (relative to the
>project). If the solution configuration is in the default Debug mode, the
>output directory is \obj\Debug. If in Release mode, it's \obj\Release. This
>is where the strong
>name key file must be placed.
>HTH,
>Piyush
><job@.bla.com> wrote in message
>news:2hkd12t1gb8ic7v3tsmrc2eehdou99okpq@.4ax.com...
>> I put my StrongNameKey.snk in my root foler.
>>
>> in my assemblyinfo.vb I have:
>> <Assembly: AssemblyKeyFileAttribute("StrongNameKey.snk")>
>>
>> I get the error "Error creating assembly manifest: Error reading key
>> file 'StrongNameKey.snk' -- The system cannot find the file
>> specified."
>>
>> ?
>>
>> /M

Thursday, March 22, 2012

Strongly Type Web Forms

How does a User Control invoke a method on its parent page? Say I have a publicMethod in code behind for an aspx page:
...
public void SomeImportantMethod() { /* do important stuff */}
...
From an Event Handler within the User Control, I'd like to invoke a method on the page in which the User Control is embedded. If I stop in the debugger and inspect this.Page, I see that it has a type of "ASP.MyAspxPage"... where did that come from? Can I delcare it intentionally somewhere?
TIA,
Geo
Your MyAspxPage is your custom page class, which inherits from the System.Web.UI.Page class.
The thing with UserControls is though, that you don't know what parent page they could be in at run-time.
So, to be safe, if you want to call a particular method on the parentPage, I'd say let your Page implement your interface which contains themethod signature (and other stuff if you want).
In your UserControl you then do a defensive cast (using the as keyword)to that interface and check for != null. You then simply call yourmethod on your interface object.
Hope that helps.
Wim

Yes, that does help. It helped in that I was hung up in anold paradigm and should get over it and just use an interface. So, thanks, that helped me get the job done.
I guess I was stuck in theOLD ASP.NET 1.1 code behind days where an ASPX page would have a code behind page which had a namespace declaration and the web form would be a public class derived from System.Web.UI.Page. So, from any C# code I could say:
MyNamespace.MyPage myPage = this.Page as MyNameSpace.MyPage;
if ( myPage != null)
{
myPage.MyMethod("hello world");
}
else
{
Response.Write("what gives?");
}
No fuss no muss, no interfaces.
I think I better go find an article or 2 on code beside or what ever it is we call it now.
Thanks again,
geo

Hello.

I think that you can also use the @.reference directive to introduce the type of the page in the user control (haven't tried it though).

Tuesday, March 13, 2012

stuck with the guided tutorial

Hi all,

i am new to asp.net and just starting out with WebMatrix
guided tour tutorial from ASP.NET. I managed to create the
myfirstpage.aspx (Label, text, calendar, button) and ran
it with webmatrix server smoothly.

However when I tried to create and use the IIS Virtual
Root (under Start Web Application), the browser only
showed the Label part. It also showed an exclamation mark
(error sign). I even copied the myfirstpage.aspx file to
the default web folder (\Inetpub\wwwroot) but to no avail.

What did I do wrong?

I did install everything, right:
IIS
the .NEt framework
webmatrix
sql2kdesksp3.exe
and mdac 2.7

The system runs on Windows 2000 Pro SP4 and it has its own
static IP.

I tried the iis ftp and web using regular html and it
works fine... but not the myfirstpage.aspx.

HElppppp.This could be becuase asp.net is not registered in the iis. try the following:

cd %windir%\microsoft.net\framework\v1.0.3705
aspnet_regiis -i

HTH

-aka
Alleluia... Thank you, it works. Thanks a bunch.

mitoshie