Saturday, March 31, 2012

Simulating a windows service

So I only have VWD and therefore can not create a windows service. I found this articlehttp://www.codeproject.com/aspnet/aspnetservice.asp and wanted some feedback on whether this is really a reliable solution or if I'm going to have to fork over the cash and buy Visual Studio Pro. I set this up this past friday, it worked until about 9pm. Monday morning I had to restart IIS to get it going and now on tuesday morning its still working.

I believe you can produce console applications with the Express editions (not VWD, but C# or VB). You can create a console app that does what you want then schedule it using the Windows scheduler to run when you want. You may get a console popping up but it'll disappear as soon as it has run. Result is pretty much the same as using a Windows service. I have a feeling you can also create a Windows service using the .Net SDK, but you'll probably have to do some command line compilation and build the installer in code by hand - not sure though, never tried it myself.


Hi jhoop2002,

jhoop2002:

So I only have VWD and therefore can not create a windows service.

thats right, but with Visual C# or VB you can. There is no template to create a windows service in the express editions, but that's not really a problem. I now itWink

jhoop2002:

I found this articlehttp://www.codeproject.com/aspnet/aspnetservice.asp and wanted some feedback on whether this is really a reliable solution or if I'm going to have to fork over the cash and buy Visual Studio Pro.

Very interested article, really. But this have nothing to do with the version of VS youre using. I think the real question is: will you use the ready coded solution from this article, or sit down and create a windows service from ground up. Yes, its a lot of work at the first time. But keep in mind, you learn a lot while doing this job.

Anyway, only my two cents.


Well, I'm a network admin thats had a programmers hat thrown on him, so I would much rather take the ready coded solution from the article. I guess i was just wondering if its reliable enough.


jhoop2002:

Well, I'm a network admin thats had a programmers hat thrown on him, so I would much rather take the ready coded solution from the article.

... self-explanatory.

jhoop2002:

I guess i was just wondering if its reliable enough.

but remeber, all the different jobs are hostet by the IIS, who's running as a service. So when IIS crashs, all the jobs are crashed also. A windows service is running in its own context and so a windows service is really more reliable.

If you think this solution is reliable enough for you, so go this way.


Sorry, double post.


Sorry, double post.


Sorry, double post.

Simulating a Web Service Application

Hi All,
I'm in a strange situation.
I have WSDL files generated by a apache Axis software. But i dont have
access to the application, becuase of few reasons. I want to validate
the application that I'm preparing now.
Anybody had overcome such situation? Expects some help from you.
Thanks in Advance.
AnbuWhat kind of validation you want to do?
"Anbu" <Anbu.Thangarathinam@.gmail.com> wrote in message
news:1150896182.258265.172170@.m73g2000cwd.googlegroups.com...
> Hi All,
> I'm in a strange situation.
> I have WSDL files generated by a apache Axis software. But i dont have
> access to the application, becuase of few reasons. I want to validate
> the application that I'm preparing now.
> Anybody had overcome such situation? Expects some help from you.
> Thanks in Advance.
> Anbu
>
Well if you have the wsdl you can easily setup a dummy service on your local
system just copy the method signatures in a new webservice project
add some ( expected ) standard return values and test your program with that
regards
Michel Posseth [MCP]
"Anbu" <Anbu.Thangarathinam@.gmail.com> schreef in bericht
news:1150896182.258265.172170@.m73g2000cwd.googlegroups.com...
> Hi All,
> I'm in a strange situation.
> I have WSDL files generated by a apache Axis software. But i dont have
> access to the application, becuase of few reasons. I want to validate
> the application that I'm preparing now.
> Anybody had overcome such situation? Expects some help from you.
> Thanks in Advance.
> Anbu
>
Will the free online wsdl validator at
http://www.mgateway.com/wsdlValidator.htm help you?
Anbu wrote:
> Hi All,
> I'm in a strange situation.
> I have WSDL files generated by a apache Axis software. But i dont have
> access to the application, becuase of few reasons. I want to validate
> the application that I'm preparing now.
> Anybody had overcome such situation? Expects some help from you.
> Thanks in Advance.
> Anbu

simulating browser cookie management

Hello,

I am trying to write a script for testing web
applications. It needs to be able to authenticate user
and manage state through cookies. Is it possible to
simulate cookie management like a browser? If so, how?

Thank you,

Martin KubaMartin,

Look at System.Net.CookieContainer.

--
John Saunders
Internet Engineer
john.saunders@.surfcontrol.com

"Martin Kuba" <martin@.loyalcare.com> wrote in message
news:038f01c35ad3$47ded110$a601280a@.phx.gbl...
> Hello,
> I am trying to write a script for testing web
> applications. It needs to be able to authenticate user
> and manage state through cookies. Is it possible to
> simulate cookie management like a browser? If so, how?
> Thank you,
> Martin Kuba
John,

Thanks for your response. Do you know where I could find
a real-world example of using this class? MSDN has only
description of the class members. It would help me get
up to speed faster. Thanks again.

Martin

>--Original Message--
>Martin,
>Look at System.Net.CookieContainer.
>--
>John Saunders
>Internet Engineer
>john.saunders@.surfcontrol.com
>
>"Martin Kuba" <martin@.loyalcare.com> wrote in message
>news:038f01c35ad3$47ded110$a601280a@.phx.gbl...
>> Hello,
>>
>> I am trying to write a script for testing web
>> applications. It needs to be able to authenticate user
>> and manage state through cookies. Is it possible to
>> simulate cookie management like a browser? If so, how?
>>
>> Thank you,
>>
>> Martin Kuba
>
>.
Martin,

The code I gave you _is_ a real-world example. That's' all there is to it!

Did you have more in mind?

--
John Saunders
Internet Engineer
john.saunders@.surfcontrol.com

"Martin Kuba" <martin@.loyalcare.com> wrote in message
news:039101c35ad6$5c75efc0$a501280a@.phx.gbl...
> John,
> Thanks for your response. Do you know where I could find
> a real-world example of using this class? MSDN has only
> description of the class members. It would help me get
> up to speed faster. Thanks again.
> Martin
>
> >--Original Message--
> >Martin,
> >Look at System.Net.CookieContainer.
> >--
> >John Saunders
> >Internet Engineer
> >john.saunders@.surfcontrol.com
> >"Martin Kuba" <martin@.loyalcare.com> wrote in message
> >news:038f01c35ad3$47ded110$a601280a@.phx.gbl...
> >> Hello,
> >>
> >> I am trying to write a script for testing web
> >> applications. It needs to be able to authenticate user
> >> and manage state through cookies. Is it possible to
> >> simulate cookie management like a browser? If so, how?
> >>
> >> Thank you,
> >>
> >> Martin Kuba
> >.

simulating MDI in ASP.NET

The IT Manager where I'm working prizes "no touch" deployment
above all else. The instructions I've been given are basically
this: if it's possible in ASP.NET, write it in ASP.NET; use
WinForms only as a last resort.
One of the departments has specified that they need to have
multiple Customer records open at the same time, in different
windows. If they're handling a call from CustomerA and another
call comes in from CustomerB, they need to put CustomerA on hold
and open CustomerB's record, etc etc.
Any suggestions for simulating MDI in ASP.NET?
Thanks!
TimoIn ASP.NET your code is rendered by a web browser. I don't thing there is a
browser that implements MDI. What you should rather do is to open customer
records in a separate browser window. You can achieve it on client side
using JavaScript call window.open (...).
Eliyahu
"Timo" <timo@.noneofyer.biz> wrote in message
news:MPG.1af58ec65cfeb1499896ef@.msnews.microsoft.com...
> The IT Manager where I'm working prizes "no touch" deployment
> above all else. The instructions I've been given are basically
> this: if it's possible in ASP.NET, write it in ASP.NET; use
> WinForms only as a last resort.
> One of the departments has specified that they need to have
> multiple Customer records open at the same time, in different
> windows. If they're handling a call from CustomerA and another
> call comes in from CustomerB, they need to put CustomerA on hold
> and open CustomerB's record, etc etc.
> Any suggestions for simulating MDI in ASP.NET?
> Thanks!
> Timo
>
>
Hi Eliyahu,
Thanks for the reply. Window.open with javascript can certainly
open multiple windows, but I was thinking perhaps there was a
custom control that simulated MDI using multiple panes inside a
single webform or something like that. I was also hoping it might
be possible to get the panes to move around the screen using drag-
drop if such a control implemented CSOM (which is beyond my
programming experience) or to have one of these pseudo-forms
superimposed upon another using z-index. BTW, this would not have
to be a cross-browser solution; we're using IE6.
Timo
In article <#2UqfPtKEHA.2624@.TK2MSFTNGP09.phx.gbl>,
removemeegoldin@.monarchmed.com writes...
>In ASP.NET your code is rendered by a web browser. I don't thing there is a
>browser that implements MDI. What you should rather do is to open customer
>records in a separate browser window. You can achieve it on client side
>using JavaScript call window.open (...).
>Eliyahu
>"Timo" <timo@.noneofyer.biz> wrote in message
>news:MPG.1af58ec65cfeb1499896ef@.msnews.microsoft.com...
>
>
You might be able to do this with IFrames. I suspect, however, that to
achieve the results you really want will require a bit of DHTML coding.
"Timo" <timo@.noneofyer.biz> wrote in message
news:MPG.1af58ec65cfeb1499896ef@.msnews.microsoft.com...
> The IT Manager where I'm working prizes "no touch" deployment
> above all else. The instructions I've been given are basically
> this: if it's possible in ASP.NET, write it in ASP.NET; use
> WinForms only as a last resort.
> One of the departments has specified that they need to have
> multiple Customer records open at the same time, in different
> windows. If they're handling a call from CustomerA and another
> call comes in from CustomerB, they need to put CustomerA on hold
> and open CustomerB's record, etc etc.
> Any suggestions for simulating MDI in ASP.NET?
> Thanks!
> Timo
>
>
Web-based applications have their own GUI culture, it is not a good idea to
make a web application look and feel exactly as a Windows one. I remember
early 90s when Windows started taking over MS-DOS. Imagine a Windows program
that would look exactly as MS-DOS one.
Eliyahu
"Timo" <timo@.noneofyer.biz> wrote in message
news:MPG.1af5b551d33a800a9896f0@.msnews.microsoft.com...
> Hi Eliyahu,
> Thanks for the reply. Window.open with javascript can certainly
> open multiple windows, but I was thinking perhaps there was a
> custom control that simulated MDI using multiple panes inside a
> single webform or something like that. I was also hoping it might
> be possible to get the panes to move around the screen using drag-
> drop if such a control implemented CSOM (which is beyond my
> programming experience) or to have one of these pseudo-forms
> superimposed upon another using z-index. BTW, this would not have
> to be a cross-browser solution; we're using IE6.
> Timo
>
> In article <#2UqfPtKEHA.2624@.TK2MSFTNGP09.phx.gbl>,
> removemeegoldin@.monarchmed.com writes...
a
customer
Using Framesets is similar to MDI in some respects (although you should know
that Frames need to be used in moderation).
Obviously that won't give you the movability, but then you might want to
reconsider whether that would provide the best user experience anyway.
Many people would find it confusing/annoying.
"Timo" <timo@.noneofyer.biz> wrote in message
news:MPG.1af5b551d33a800a9896f0@.msnews.microsoft.com...
> Hi Eliyahu,
> Thanks for the reply. Window.open with javascript can certainly
> open multiple windows, but I was thinking perhaps there was a
> custom control that simulated MDI using multiple panes inside a
> single webform or something like that. I was also hoping it might
> be possible to get the panes to move around the screen using drag-
> drop if such a control implemented CSOM (which is beyond my
> programming experience) or to have one of these pseudo-forms
> superimposed upon another using z-index. BTW, this would not have
> to be a cross-browser solution; we're using IE6.
> Timo
>
> In article <#2UqfPtKEHA.2624@.TK2MSFTNGP09.phx.gbl>,
> removemeegoldin@.monarchmed.com writes...
a
customer
Timo,
First, I would ask around to see if Citrix is in house.
I'm in a similar situation concerning the deploymnet issue,
and to me it often makes more sense to put complex window apps on a
server rather than try to replace them with browser apps.
On the other hand, one possible take on your problem would be to create
a User Control to hold the customer info, and
set up a page where you could hold multiple copies (hopefully not too
many) of this control. Then you could populate them and make them
visible as you worked with the customers. If they're on the same page
you could toggle the visibility of each control without losing the info.
Jim
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!

simulating MDI in ASP.NET

The IT Manager where I'm working prizes "no touch" deployment
above all else. The instructions I've been given are basically
this: if it's possible in ASP.NET, write it in ASP.NET; use
WinForms only as a last resort.

One of the departments has specified that they need to have
multiple Customer records open at the same time, in different
windows. If they're handling a call from CustomerA and another
call comes in from CustomerB, they need to put CustomerA on hold
and open CustomerB's record, etc etc.

Any suggestions for simulating MDI in ASP.NET?

Thanks!
TimoIn ASP.NET your code is rendered by a web browser. I don't thing there is a
browser that implements MDI. What you should rather do is to open customer
records in a separate browser window. You can achieve it on client side
using JavaScript call window.open (...).

Eliyahu

"Timo" <timo@.noneofyer.biz> wrote in message
news:MPG.1af58ec65cfeb1499896ef@.msnews.microsoft.c om...
> The IT Manager where I'm working prizes "no touch" deployment
> above all else. The instructions I've been given are basically
> this: if it's possible in ASP.NET, write it in ASP.NET; use
> WinForms only as a last resort.
> One of the departments has specified that they need to have
> multiple Customer records open at the same time, in different
> windows. If they're handling a call from CustomerA and another
> call comes in from CustomerB, they need to put CustomerA on hold
> and open CustomerB's record, etc etc.
> Any suggestions for simulating MDI in ASP.NET?
> Thanks!
> Timo
Hi Eliyahu,
Thanks for the reply. Window.open with javascript can certainly
open multiple windows, but I was thinking perhaps there was a
custom control that simulated MDI using multiple panes inside a
single webform or something like that. I was also hoping it might
be possible to get the panes to move around the screen using drag-
drop if such a control implemented CSOM (which is beyond my
programming experience) or to have one of these pseudo-forms
superimposed upon another using z-index. BTW, this would not have
to be a cross-browser solution; we're using IE6.
Timo

In article <#2UqfPtKEHA.2624@.TK2MSFTNGP09.phx.gbl>,
removemeegoldin@.monarchmed.com writes...
>In ASP.NET your code is rendered by a web browser. I don't thing there is a
>browser that implements MDI. What you should rather do is to open customer
>records in a separate browser window. You can achieve it on client side
>using JavaScript call window.open (...).
>Eliyahu
>"Timo" <timo@.noneofyer.biz> wrote in message
>news:MPG.1af58ec65cfeb1499896ef@.msnews.microsoft.c om...
>> The IT Manager where I'm working prizes "no touch" deployment
>> above all else. The instructions I've been given are basically
>> this: if it's possible in ASP.NET, write it in ASP.NET; use
>> WinForms only as a last resort.
>>
>> One of the departments has specified that they need to have
>> multiple Customer records open at the same time, in different
>> windows. If they're handling a call from CustomerA and another
>> call comes in from CustomerB, they need to put CustomerA on hold
>> and open CustomerB's record, etc etc.
>>
>> Any suggestions for simulating MDI in ASP.NET?
>>
>> Thanks!
>> Timo
>>
>>
>>
>
You might be able to do this with IFrames. I suspect, however, that to
achieve the results you really want will require a bit of DHTML coding.

"Timo" <timo@.noneofyer.biz> wrote in message
news:MPG.1af58ec65cfeb1499896ef@.msnews.microsoft.c om...
> The IT Manager where I'm working prizes "no touch" deployment
> above all else. The instructions I've been given are basically
> this: if it's possible in ASP.NET, write it in ASP.NET; use
> WinForms only as a last resort.
> One of the departments has specified that they need to have
> multiple Customer records open at the same time, in different
> windows. If they're handling a call from CustomerA and another
> call comes in from CustomerB, they need to put CustomerA on hold
> and open CustomerB's record, etc etc.
> Any suggestions for simulating MDI in ASP.NET?
> Thanks!
> Timo
Web-based applications have their own GUI culture, it is not a good idea to
make a web application look and feel exactly as a Windows one. I remember
early 90s when Windows started taking over MS-DOS. Imagine a Windows program
that would look exactly as MS-DOS one.

Eliyahu

"Timo" <timo@.noneofyer.biz> wrote in message
news:MPG.1af5b551d33a800a9896f0@.msnews.microsoft.c om...
> Hi Eliyahu,
> Thanks for the reply. Window.open with javascript can certainly
> open multiple windows, but I was thinking perhaps there was a
> custom control that simulated MDI using multiple panes inside a
> single webform or something like that. I was also hoping it might
> be possible to get the panes to move around the screen using drag-
> drop if such a control implemented CSOM (which is beyond my
> programming experience) or to have one of these pseudo-forms
> superimposed upon another using z-index. BTW, this would not have
> to be a cross-browser solution; we're using IE6.
> Timo
>
> In article <#2UqfPtKEHA.2624@.TK2MSFTNGP09.phx.gbl>,
> removemeegoldin@.monarchmed.com writes...
> >In ASP.NET your code is rendered by a web browser. I don't thing there is
a
> >browser that implements MDI. What you should rather do is to open
customer
> >records in a separate browser window. You can achieve it on client side
> >using JavaScript call window.open (...).
> >Eliyahu
> >"Timo" <timo@.noneofyer.biz> wrote in message
> >news:MPG.1af58ec65cfeb1499896ef@.msnews.microsoft.c om...
> >> The IT Manager where I'm working prizes "no touch" deployment
> >> above all else. The instructions I've been given are basically
> >> this: if it's possible in ASP.NET, write it in ASP.NET; use
> >> WinForms only as a last resort.
> >>
> >> One of the departments has specified that they need to have
> >> multiple Customer records open at the same time, in different
> >> windows. If they're handling a call from CustomerA and another
> >> call comes in from CustomerB, they need to put CustomerA on hold
> >> and open CustomerB's record, etc etc.
> >>
> >> Any suggestions for simulating MDI in ASP.NET?
> >>
> >> Thanks!
> >> Timo
> >>
> >>
> >
Using Framesets is similar to MDI in some respects (although you should know
that Frames need to be used in moderation).
Obviously that won't give you the movability, but then you might want to
reconsider whether that would provide the best user experience anyway.
Many people would find it confusing/annoying.

"Timo" <timo@.noneofyer.biz> wrote in message
news:MPG.1af5b551d33a800a9896f0@.msnews.microsoft.c om...
> Hi Eliyahu,
> Thanks for the reply. Window.open with javascript can certainly
> open multiple windows, but I was thinking perhaps there was a
> custom control that simulated MDI using multiple panes inside a
> single webform or something like that. I was also hoping it might
> be possible to get the panes to move around the screen using drag-
> drop if such a control implemented CSOM (which is beyond my
> programming experience) or to have one of these pseudo-forms
> superimposed upon another using z-index. BTW, this would not have
> to be a cross-browser solution; we're using IE6.
> Timo
>
> In article <#2UqfPtKEHA.2624@.TK2MSFTNGP09.phx.gbl>,
> removemeegoldin@.monarchmed.com writes...
> >In ASP.NET your code is rendered by a web browser. I don't thing there is
a
> >browser that implements MDI. What you should rather do is to open
customer
> >records in a separate browser window. You can achieve it on client side
> >using JavaScript call window.open (...).
> >Eliyahu
> >"Timo" <timo@.noneofyer.biz> wrote in message
> >news:MPG.1af58ec65cfeb1499896ef@.msnews.microsoft.c om...
> >> The IT Manager where I'm working prizes "no touch" deployment
> >> above all else. The instructions I've been given are basically
> >> this: if it's possible in ASP.NET, write it in ASP.NET; use
> >> WinForms only as a last resort.
> >>
> >> One of the departments has specified that they need to have
> >> multiple Customer records open at the same time, in different
> >> windows. If they're handling a call from CustomerA and another
> >> call comes in from CustomerB, they need to put CustomerA on hold
> >> and open CustomerB's record, etc etc.
> >>
> >> Any suggestions for simulating MDI in ASP.NET?
> >>
> >> Thanks!
> >> Timo
> >>
> >>
> >
Timo,

First, I would ask around to see if Citrix is in house.
I'm in a similar situation concerning the deploymnet issue,
and to me it often makes more sense to put complex window apps on a
server rather than try to replace them with browser apps.

On the other hand, one possible take on your problem would be to create
a User Control to hold the customer info, and
set up a page where you could hold multiple copies (hopefully not too
many) of this control. Then you could populate them and make them
visible as you worked with the customers. If they're on the same page
you could toggle the visibility of each control without losing the info.

Jim

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Simulating Server.Transfer to another machine

I need to do the logical equivelent of Server.Transfer to another
server whos identity is known only upon receipt of the request. (The
other machine is on-site, but not addressable from the outside world,
which is one of many reasons I can't do a Redirect.)
I'm assuming I have to make another request, and then copy the response
back to the original response. What is the most efficient way of doing
this? (All servers are IIS/Asp.Net.)
thanks,
mIck. Sounds like an unfortunate problem. What sort of information is the
second server providing? Does it have to be presented as HTML?

Can you instead design your app such that you get back XML (such as a web
service) from the second server, instead of HTML? So then your first server
is really the one rendering the page to the client based upon the XML data
provided by the second? I think this will make things smoother for you in
the long run.

If not then you can use HttpWebRequest class to issue a HTTP request to the
second server and use HttpWebResponse to handle the results.

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

> I need to do the logical equivelent of Server.Transfer to another
> server whos identity is known only upon receipt of the request. (The
> other machine is on-site, but not addressable from the outside world,
> which is one of many reasons I can't do a Redirect.)
> I'm assuming I have to make another request, and then copy the
> response
> back to the original response. What is the most efficient way of doing
> this? (All servers are IIS/Asp.Net.)
> thanks,
> m
"Mike" <vimakefile@.yahoo.com> wrote in news:1110938109.479879.144170
@.g14g2000cwa.googlegroups.com:

> I'm assuming I have to make another request, and then copy the response
> back to the original response. What is the most efficient way of doing
> this? (All servers are IIS/Asp.Net.)

Seems like you may have to do a HTTPWebRequest... basically screen
scraping.

Here is more info:

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

Or could your internal app be exposed as a web service? That way the
external server can make remoting or web service calls to the back end
server to fetch the appropriate information.

--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
"Brock Allen" <ballen@.develop.com.i_hate_spam_too> wrote in message
news:7395632465175520068896@.msnews.microsoft.com.. .
> Ick. Sounds like an unfortunate problem. What sort of information is the
> second server providing? Does it have to be presented as HTML?

It's partially binary (which is why I don't want to use a web-svc and
base-64 everything) -- -- target is not a browser in this case, but I'm
using http:80 for other reasons. This is basically akin to a load-balancing
problem.
It must be a pretty common problem to solve, because I assume that's what
all those expensive magic switches (f5, Cisco, etc.) do that route your
request to an ostensibly available server, but always re-route the same
session back to the same server.

thanks,
m

> Can you instead design your app such that you get back XML (such as a web
> service) from the second server, instead of HTML? So then your first
> server is really the one rendering the page to the client based upon the
> XML data provided by the second? I think this will make things smoother
> for you in the long run.
> If not then you can use HttpWebRequest class to issue a HTTP request to
> the second server and use HttpWebResponse to handle the results.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>> I need to do the logical equivelent of Server.Transfer to another
>> server whos identity is known only upon receipt of the request. (The
>> other machine is on-site, but not addressable from the outside world,
>> which is one of many reasons I can't do a Redirect.)
>> I'm assuming I have to make another request, and then copy the
>> response
>> back to the original response. What is the most efficient way of doing
>> this? (All servers are IIS/Asp.Net.)
>> thanks,
>> m

Simulating Server.Transfer to another machine

I need to do the logical equivelent of Server.Transfer to another
server whos identity is known only upon receipt of the request. (The
other machine is on-site, but not addressable from the outside world,
which is one of many reasons I can't do a Redirect.)
I'm assuming I have to make another request, and then copy the response
back to the original response. What is the most efficient way of doing
this? (All servers are IIS/Asp.Net.)
thanks,
mIck. Sounds like an unfortunate problem. What sort of information is the
second server providing? Does it have to be presented as HTML?
Can you instead design your app such that you get back XML (such as a web
service) from the second server, instead of HTML? So then your first server
is really the one rendering the page to the client based upon the XML data
provided by the second? I think this will make things smoother for you in
the long run.
If not then you can use HttpWebRequest class to issue a HTTP request to the
second server and use HttpWebResponse to handle the results.
-Brock
DevelopMentor
http://staff.develop.com/ballen

> I need to do the logical equivelent of Server.Transfer to another
> server whos identity is known only upon receipt of the request. (The
> other machine is on-site, but not addressable from the outside world,
> which is one of many reasons I can't do a Redirect.)
> I'm assuming I have to make another request, and then copy the
> response
> back to the original response. What is the most efficient way of doing
> this? (All servers are IIS/Asp.Net.)
> thanks,
> m
"Mike" <vimakefile@.yahoo.com> wrote in news:1110938109.479879.144170
@.g14g2000cwa.googlegroups.com:

> I'm assuming I have to make another request, and then copy the response
> back to the original response. What is the most efficient way of doing
> this? (All servers are IIS/Asp.Net.)
Seems like you may have to do a HTTPWebRequest... basically screen
scraping.
Here is more info:
http://aspnet.4guysfromrolla.com/articles/122204-1.aspx
Or could your internal app be exposed as a web service? That way the
external server can make remoting or web service calls to the back end
server to fetch the appropriate information.
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
[url]http://members.ebay.com/aboutme/spot18/[/url]
"Brock Allen" <ballen@.develop.com.i_hate_spam_too> wrote in message
news:7395632465175520068896@.msnews.microsoft.com...
> Ick. Sounds like an unfortunate problem. What sort of information is the
> second server providing? Does it have to be presented as HTML?
It's partially binary (which is why I don't want to use a web-svc and
base-64 everything) -- -- target is not a browser in this case, but I'm
using http:80 for other reasons. This is basically akin to a load-balancing
problem.
It must be a pretty common problem to solve, because I assume that's what
all those expensive magic switches (f5, Cisco, etc.) do that route your
request to an ostensibly available server, but always re-route the same
session back to the same server.
thanks,
m

> Can you instead design your app such that you get back XML (such as a web
> service) from the second server, instead of HTML? So then your first
> server is really the one rendering the page to the client based upon the
> XML data provided by the second? I think this will make things smoother
> for you in the long run.
> If not then you can use HttpWebRequest class to issue a HTTP request to
> the second server and use HttpWebResponse to handle the results.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>

simulating/calling javascript functions programmatically

Hello,

I am tasked to write an application for a travel agency, that should be able to get a price for airline tickets from airline's website. Generally, airlines don't provide any web services for this, so I am sort of forced to simulate all the clicks/list boxes selection that a regular user would make. Most of those buttons have a java script associated with them, so as soon as a button's clicked -- java script runs.

So, here is the question: what's the best way to implement a call to a javascript? Would I use ASP.NET platform, since it has these HttpRequest / Response objects? What would I put in my HttpRequest?

For instance, if a web page http://www.mysite.com/page.cgi has a java script that looks something like this:

function submit_SomeForm()
{
document.SomeForm.A.value = "A"
document.SomeForm.B.value = "B"
document.SomeForm.C.value = "C"

document.SomeForm.submit()
}

What would be a code snippet that would setup SomeForm document with all the values and submit it to the site?
Also, what tools would I use to see what the http string that goes from my browser to the site is like?

I understand that I am sort of asking for a lot but I appreciate any help -- I am a rookie at this and it's tough to ask the right question :)

I appreciate any help.

Sincerely,
YRTake a look at the WebRequest class which will allow you to do GET and
POST. For example, here is a sample doing a POST :
http://samples.gotdotnet.com/quicks...clientPOST.aspx

One of the first tools I would get for debugging would be something
like tcpTrace (see http://www.pocketsoap.com/tcptrace/). This easily
allows you to see all the traffic between yourself and a web site. You
can compare what your code is sending versus what the browser sends.
Even before debugging, it will show you a little bit about what
happens on the form.submit call.

HTH,

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

On Wed, 21 Jan 2004 22:56:06 -0800, "YR"
<anonymous@.discussions.microsoft.com> wrote:

>Hello,
>I am tasked to write an application for a travel agency, that should be able to get a price for airline tickets from airline's website. Generally, airlines don't provide any web services for this, so I am sort of forced to simulate all the clicks/list boxes selection that a regular user would make. Most of those buttons have a java script associated with them, so as soon as a button's clicked -- java script runs.
>So, here is the question: what's the best way to implement a call to a javascript? Would I use ASP.NET platform, since it has these HttpRequest / Response objects? What would I put in my HttpRequest?
>For instance, if a web page http://www.mysite.com/page.cgi has a java script that looks something like this:
>function submit_SomeForm()
>{
> document.SomeForm.A.value = "A"
> document.SomeForm.B.value = "B"
> document.SomeForm.C.value = "C"
> document.SomeForm.submit()
>}
>What would be a code snippet that would setup SomeForm document with all the values and submit it to the site?
>Also, what tools would I use to see what the http string that goes from my browser to the site is like?
>I understand that I am sort of asking for a lot but I appreciate any help -- I am a rookie at this and it's tough to ask the right question :)
>I appreciate any help.
>Sincerely,
>YR
Take a look at the WebRequest class which will allow you to do GET and
POST. For example, here is a sample doing a POST :
http://samples.gotdotnet.com/quicks...clientPOST.aspx

One of the first tools I would get for debugging would be something
like tcpTrace (see http://www.pocketsoap.com/tcptrace/). This easily
allows you to see all the traffic between yourself and a web site. You
can compare what your code is sending versus what the browser sends.
Even before debugging, it will show you a little bit about what
happens on the form.submit call.

HTH,

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

On Wed, 21 Jan 2004 22:56:06 -0800, "YR"
<anonymous@.discussions.microsoft.com> wrote:

>Hello,
>I am tasked to write an application for a travel agency, that should be able to get a price for airline tickets from airline's website. Generally, airlines don't provide any web services for this, so I am sort of forced to simulate all the clicks/list boxes selection that a regular user would make. Most of those buttons have a java script associated with them, so as soon as a button's clicked -- java script runs.
>So, here is the question: what's the best way to implement a call to a javascript? Would I use ASP.NET platform, since it has these HttpRequest / Response objects? What would I put in my HttpRequest?
>For instance, if a web page http://www.mysite.com/page.cgi has a java script that looks something like this:
>function submit_SomeForm()
>{
> document.SomeForm.A.value = "A"
> document.SomeForm.B.value = "B"
> document.SomeForm.C.value = "C"
> document.SomeForm.submit()
>}
>What would be a code snippet that would setup SomeForm document with all the values and submit it to the site?
>Also, what tools would I use to see what the http string that goes from my browser to the site is like?
>I understand that I am sort of asking for a lot but I appreciate any help -- I am a rookie at this and it's tough to ask the right question :)
>I appreciate any help.
>Sincerely,
>YR
I had a similar query (actually posted it just before yours) and found my
answer in the Page.RegisterClientScriptBlock method. It lets you add client
side Javascript to your page from within your server side ASP.NET code.

Regards,

Lachlan
Thanks.

YR
Thanks.

YR

simulating varios browser environments

My web server is IIS 6.0 on Windows 2003 Server but my clients can vary from IE, Netscape, Mozilla, Firefox on PC to Safari on Mac. Is there a way I can simulate this environment to test my application? For PC clients, I guess I can just download multiple browsers and run the application in different browsers but what about Mac?Hi,

Take a look @.Browser Photo

HTH
On my development PC, my resolution is set to 1152x864 but I want to develop (and test) my ASP.NET application that will be for 800x600 resolution.

How?
Hi

Create html table and set width="100%" and put all the contents in side the table.


<HTML>
<HEAD>
<TITLE>Page title</TITLE>
</HEAD>
<BODY>
<TABLEWIDTH="100%">
<TR>
<TD
Put your page contents here

</TD>
</TR>
</TABLE>
</BODY>
</HTML>

HTH
That I know but I want to "simulate" different resolutions so that when I put my control on a page I know if it is going to fit or not.

Simulation of Button click

I have a WebForm with C# and JavaScript functions -

The aspx file holds two buttons: Button1 and Button2

In Page_Load (code behind), I have Button2.Attributes.Add
("onclick", "func()");

My program works if I first press Button1 with the mouse
and then press Button2 with the mouse.

I'd like to run the same program by physically pressing
only Button1.

I'd like the code in the event handler of Button1 to run
first, then have the (programatic) pressing of Button2
cause the JavaScript function func() to run as a result
of the Button2 "onclick" event.Perhaps this thread at ASP.NEt Forums gives you starters:
http://www.asp.net/Forums/ShowPost...1&PostID=406072

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"mg" <mg@.theworld.com> wrote in message
news:042c01c3b611$76fd8010$a101280a@.phx.gbl...
> I have a WebForm with C# and JavaScript functions -
> The aspx file holds two buttons: Button1 and Button2
> In Page_Load (code behind), I have Button2.Attributes.Add
> ("onclick", "func()");
> My program works if I first press Button1 with the mouse
> and then press Button2 with the mouse.
> I'd like to run the same program by physically pressing
> only Button1.
> I'd like the code in the event handler of Button1 to run
> first, then have the (programatic) pressing of Button2
> cause the JavaScript function func() to run as a result
> of the Button2 "onclick" event.
It will be helpful if you could explain your processing flow in greater detail.

1. Are button1 and button2 web controls or html controls?
2. Does button1 and button2 fire server-side event or only client-side event.
3. Why do you need to press button2 to call a javascript function?
Why can't you just call the javascript function directly?

Tommy,

"mg" <mg@.theworld.com> wrote in message news:<042c01c3b611$76fd8010$a101280a@.phx.gbl>...
> I have a WebForm with C# and JavaScript functions -
> The aspx file holds two buttons: Button1 and Button2
> In Page_Load (code behind), I have Button2.Attributes.Add
> ("onclick", "func()");
> My program works if I first press Button1 with the mouse
> and then press Button2 with the mouse.
> I'd like to run the same program by physically pressing
> only Button1.
> I'd like the code in the event handler of Button1 to run
> first, then have the (programatic) pressing of Button2
> cause the JavaScript function func() to run as a result
> of the Button2 "onclick" event.

Simultaneous processing

Hi everyone,

I need to develop a new asp.net 2.0 web app that has to allow a client the ability to work with an internal adviser on the same document (an offer) at the same time. I am not sure how to allow two persons working on the same application and changes be reflected to both browsers. For sharing the data, I could set up a DB, apply a unique ID that they both would use to manipulate the common data. The problem that I have is with the ASP.NET application, which I don't know how to build to allow two persons working simultaneously on a set of data and see instantly the changes the other person does.

Hope my explanation is clear :-) I would appreciate any help, comments, or suggestions.

Thanks.
Mikebrowsers don't an event model. you will ave to use a polling techinque. look
at an ajax library for this support. as you will be doing client script and
dhtml, brush up on html. i'd use the html controls and not the asp.net ones.

-- bruce (sqlwork.com)
Hi Bruce,

Do you have any additional information (links, blogs, etc.) on how to use a
polling technique? What about a timer on the server-side that pulls the data
and, through AJAX, sends it to the related browsers?

Thanks.
Mike

"bruce barker (sqlwork.com)" <b_r_u_c_e_removeunderscores@.sqlwork.comwrote
in message news:OSmLPRxtGHA.3552@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

browsers don't an event model. you will ave to use a polling techinque.
look at an ajax library for this support. as you will be doing client
script and dhtml, brush up on html. i'd use the html controls and not the
asp.net ones.
>
-- bruce (sqlwork.com)
>
>


Hi,

Mike wrote:

Quote:

Originally Posted by

Hi Bruce,
>
Do you have any additional information (links, blogs, etc.) on how to use a
polling technique? What about a timer on the server-side that pulls the data
and, through AJAX, sends it to the related browsers?
>
Thanks.
Mike


You still have it wrong. The server cannot send data to the browser
without being asked first. This is the request/response model. A
"normal" request or an AJAX request are not different for the server,
they must come first, and then only the server can answer them.

Polling is a mechanism where the client sends a request periodically to
the server. JavaScript has two built-in timer methods: One "single shot"
one and one periodical one:
http://developer.mozilla.org/en/doc...ndow.setTimeout
and
http://developer.mozilla.org/en/doc...dow.setInterval
Use these methods to send periodic requests to the server.

My preferate way is to send a request, then wait for the response (or an
error), then use setTimeout to start a timer. When the timer expires,
send the next request. Use config files to modify the polling delay.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

Simultaneous processing

Hi everyone,

I need to develop a new asp.net 2.0 web app that has to allow a client the ability to work with an internal adviser on the same document (an offer) at the same time. I am not sure how to allow two persons working on the same application and changes be reflected to both browsers. For sharing the data, I could set up a DB, apply a unique ID that they both would use to manipulate the common data. The problem that I have is with the ASP.NET application, which I don't know how to build to allow two persons working simultaneously on a set of data and see instantly the changes the other person does.

Hope my explanation is clear :-) I would appreciate any help, comments, or suggestions.

Thanks.
MikeSorry for posting so many times... I had a network problem and unfortunately has been sent 3 times.

Sorry again.
Mike

"Mike" <none@.none.comwrote in message news:eZOgMDxtGHA.3264@.TK2MSFTNGP03.phx.gbl...

Hi everyone,

I need to develop a new asp.net 2.0 web app that has to allow a client the ability to work with an internal adviser on the same document (an offer) at the same time. I am not sure how to allow two persons working on the same application and changes be reflected to both browsers. For sharing the data, I could set up a DB, apply a unique ID that they both would use to manipulate the common data. The problem that I have is with the ASP.NET application, which I don't know how to build to allow two persons working simultaneously on a set of data and see instantly the changes the other person does.

Hope my explanation is clear :-) I would appreciate any help, comments, or suggestions.

Thanks.
Mike
This is hard enough working in a regular application. When you add in the
disconnected nature of web pages, you make it pretty damn near impossible.
There is no "instant" update from server to client. Clients send requests to
the server, which services the request. That's how the whole things works.
Ajax (Atlas, to MS) can give the user the impression that this is not the
case, but it still is. Your web application will have to send updates to the
server, which will then do some processing and send the results back to the
client machine, which then can be displayed to the user. If this was a
perfect world, such a system as you describe would be simple to implement.
However, you must consider that requests are served in a multithreaded
environment, so you might have person A attempting to update a document at
the same time person B is. What if person B deletes a sentence, and his
update goes through, and then person A submits an update with that sentence
still in there. Is it put back in? Is it deleted again? This sort of
conflict resolution is damn hard to code. Your best bet would be to restrict
access to the document to one individual at the time, using Atlas to send
updates and do refreshes in the background. Good luck.

"Mike" wrote:

Quote:

Originally Posted by

>
Hi everyone,
>
I need to develop a new asp.net 2.0 web app that has to allow a client the ability to work with an internal adviser on the same document (an offer) at the same time. I am not sure how to allow two persons working on the same application and changes be reflected to both browsers. For sharing the data, I could set up a DB, apply a unique ID that they both would use to manipulate the common data. The problem that I have is with the ASP.NET application, which I don't know how to build to allow two persons working simultaneously on a set of data and see instantly the changes the other person does.
>
Hope my explanation is clear :-) I would appreciate any help, comments, or suggestions.
>
Thanks


Thanks for your thoughts on this one. I agree that it is a challenge.

I was thinking about a combination of Ajax (Atlas) and events raised on the
server to push the updates to the related browser at the other end. I would
lock the document for the customer and only allow the internal adviser to
make any modifications on the document. Would this be feasible? My question
would be how to keep the two persons on each end (customer and intenal
adviser) connected and related all of the time.

Any suggestions on this one?

Thanks.
Mike

"William Sullivan" <WilliamSullivan@.discussions.microsoft.comwrote in
message news:AA1047A3-E5C0-48B2-B8BC-E3149BE09A11@.microsoft.com...

Quote:

Originally Posted by

This is hard enough working in a regular application. When you add in the
disconnected nature of web pages, you make it pretty damn near impossible.
There is no "instant" update from server to client. Clients send requests
to
the server, which services the request. That's how the whole things
works.
Ajax (Atlas, to MS) can give the user the impression that this is not the
case, but it still is. Your web application will have to send updates to
the
server, which will then do some processing and send the results back to
the
client machine, which then can be displayed to the user. If this was a
perfect world, such a system as you describe would be simple to implement.
However, you must consider that requests are served in a multithreaded
environment, so you might have person A attempting to update a document at
the same time person B is. What if person B deletes a sentence, and his
update goes through, and then person A submits an update with that
sentence
still in there. Is it put back in? Is it deleted again? This sort of
conflict resolution is damn hard to code. Your best bet would be to
restrict
access to the document to one individual at the time, using Atlas to send
updates and do refreshes in the background. Good luck.
>
"Mike" wrote:
>

Quote:

Originally Posted by

>>
>Hi everyone,
>>
>I need to develop a new asp.net 2.0 web app that has to allow a client
>the ability to work with an internal adviser on the same document (an
>offer) at the same time. I am not sure how to allow two persons working
>on the same application and changes be reflected to both browsers. For
>sharing the data, I could set up a DB, apply a unique ID that they both
>would use to manipulate the common data. The problem that I have is with
>the ASP.NET application, which I don't know how to build to allow two
>persons working simultaneously on a set of data and see instantly the
>changes the other person does.
>>
>Hope my explanation is clear :-) I would appreciate any help, comments,
>or suggestions.
>>
>Thanks


You can't raise events on the server and have them consumed on the client.
You'll have to resort to polling. Sounds like you might be better off with
some type of activex component...

"Mike" wrote:

Quote:

Originally Posted by

>
Thanks for your thoughts on this one. I agree that it is a challenge.
>
I was thinking about a combination of Ajax (Atlas) and events raised on the
server to push the updates to the related browser at the other end. I would
lock the document for the customer and only allow the internal adviser to
make any modifications on the document. Would this be feasible? My question
would be how to keep the two persons on each end (customer and intenal
adviser) connected and related all of the time.
>
Any suggestions on this one?
>
Thanks.
Mike
>
>
>
"William Sullivan" <WilliamSullivan@.discussions.microsoft.comwrote in
message news:AA1047A3-E5C0-48B2-B8BC-E3149BE09A11@.microsoft.com...

Quote:

Originally Posted by

This is hard enough working in a regular application. When you add in the
disconnected nature of web pages, you make it pretty damn near impossible.
There is no "instant" update from server to client. Clients send requests
to
the server, which services the request. That's how the whole things
works.
Ajax (Atlas, to MS) can give the user the impression that this is not the
case, but it still is. Your web application will have to send updates to
the
server, which will then do some processing and send the results back to
the
client machine, which then can be displayed to the user. If this was a
perfect world, such a system as you describe would be simple to implement.
However, you must consider that requests are served in a multithreaded
environment, so you might have person A attempting to update a document at
the same time person B is. What if person B deletes a sentence, and his
update goes through, and then person A submits an update with that
sentence
still in there. Is it put back in? Is it deleted again? This sort of
conflict resolution is damn hard to code. Your best bet would be to
restrict
access to the document to one individual at the time, using Atlas to send
updates and do refreshes in the background. Good luck.

"Mike" wrote:

Quote:

Originally Posted by

>
Hi everyone,
>
I need to develop a new asp.net 2.0 web app that has to allow a client
the ability to work with an internal adviser on the same document (an
offer) at the same time. I am not sure how to allow two persons working
on the same application and changes be reflected to both browsers. For
sharing the data, I could set up a DB, apply a unique ID that they both
would use to manipulate the common data. The problem that I have is with
the ASP.NET application, which I don't know how to build to allow two
persons working simultaneously on a set of data and see instantly the
changes the other person does.
>
Hope my explanation is clear :-) I would appreciate any help, comments,
or suggestions.
>
Thanks


>
>
>

SIMULTANOUS USERS |||||||

Hi ppl, I have the following questions:

1) I have just finished my ASP.net Portal Project and everything works ok. But I'm stuck ! what do I do next ? i.e. do Have to copy the .aspx files to some special folder or is there a deployment tool in VS.net?
2) I am expecting to have large number of visitors entering the portal and each sesion will query the database many time during the process. Is there a 'safe' limit of how many users can simultaiously use the site withugh creashing it and if yes, how can I prevent new users from assessing the site when the max number is reached ?
THANK YOU
PLAESE HELP !Crying [:'(]

1) You need to copy over the .aspx files and the web.config file onto your web servers directory. Make sure the directory is set as an application directory in IIS. Also you need to have a bin directory in your root application directory and this is where you store all your dlls.
2) It's pretty simple to limit the amount of users. Just put code in your global.asax on the SessionStart and SessionEnd functions to hold who is using your system. Use a hash table with SessionID as the key. Make a function to check it to see if you are at your max and make sure you call it at the start of every page or just your login page if that is the entry point.
Hope that helps you get the ball rolling.

Simultanious request for the same session?

Is it possible to get 2 simultaneous request for one session in .NET?
Or Session object is automatically holds second request until first one is
not processed?

Thanks.
George.did you ever find a solution to this problem?

Since asp.net 2 officially not yet released

the question is is the right thing to use its capabilities

because there will be changes

in general the question if someone starts a new project(for a payment)
in asp.net wich asp.net version to use??This is a difficult question to answer. It primarily depends upon the person paying the money and their level of comfort with using beta software to build a new project and their comfort with waiting on the ship date for ASP.NET 2.0. If it's a 6-month project, then personally I'd learn towards 2.0. If it's a 2-month project then I'd probably have to go with 1.1.

Now there is a go-live license with beta2 which means you'll be allowed to run a commercial site on beta 2 and be able to get support from Microsoft. Though, I don't know the process for obtaining this go-live license. I think I heard Fredrik mention that you had to do some paperwork with Microsoft to obtain the go-live license. Perhaps he or someone from Microsoft can elaborate on the details of the go-live license and obtaining one. (And correct me if I've misspoken on any aspects of the legality and/or support one might expect from Microsoft.)

-Brock
I see
I think that i will wait a little bit and think what to do next obout it
and about go-live license with beta2 ,personally i don't hear obout it nothing

sorry for my english <''>

Since when is a Refresh a PostBack?

I'm getting into the habit of checking IsPostBack in my Form_Load handler
and not updating the page if it is a postback.
However, I notice that if I hit my browser's refresh button, the page
refreshes without any data.
Since when is a refresh a postback?
Thanks.
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com"Jonathan Wood" <jwood@.softcircuits.com> wrote in message
news:ey%236Y56aIHA.4696@.TK2MSFTNGP05.phx.gbl...

> Since when is a refresh a postback?
The Refresh button reloads the page in exactly the way that it was
originally loaded... If it was originally loaded as a result of a postback,
then hitting the Refresh button will cause it to be reloaded as from a
postback...
This is standard browser behaviour...
Mark Rae
ASP.NET MVP
http://www.markrae.net
A postback is no more than setting 2 hidden fields __EVENTTARGET and
__EVENTARGUMENT and calling the form's submit() method.
What hitting the Refresh button does is repeating the last submit() call
with exactly the same settings of all fields. Hence you get the effect you
are observing.
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Jonathan Wood" <jwood@.softcircuits.com> wrote in message
news:ey%236Y56aIHA.4696@.TK2MSFTNGP05.phx.gbl...
> I'm getting into the habit of checking IsPostBack in my Form_Load handler
> and not updating the page if it is a postback.
> However, I notice that if I hit my browser's refresh button, the page
> refreshes without any data.
> Since when is a refresh a postback?
> Thanks.
> --
> Jonathan Wood
> SoftCircuits Programming
> http://www.softcircuits.com
>
Wednesday, January 23, 2008
2:10 PM
This is a matter of where you're doing your databinding and how...
Say you have a grid and you have something like this you may have trouble
if not isPostback then
griddatabinding ()

end if
I am suggesting that your databinding is done in code. If so, then you will
experience the kind of problem you are indicating. If you have disable
viewstate then you will also loose your grid style assuming you did every
thing programmatically.
The answer
If not isPostback the n

End if
' move this outside your if statement
Griddatabinding()
You may have something similar in your code. If not post some code so we
can help analyze the problem.
aaa
"Jonathan Wood" wrote:

> I'm getting into the habit of checking IsPostBack in my Form_Load handler
> and not updating the page if it is a postback.
> However, I notice that if I hit my browser's refresh button, the page
> refreshes without any data.
> Since when is a refresh a postback?
> Thanks.
> --
> Jonathan Wood
> SoftCircuits Programming
> http://www.softcircuits.com
>
Yeah, okay, I may have more going on here than I originally thought.
Thanks for putting me back on the right track.
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Mark Rae [MVP]" <mark@.markNOSPAMrae.net> wrote in message
news:%239LdMa8aIHA.4140@.TK2MSFTNGP04.phx.gbl...
> "Jonathan Wood" <jwood@.softcircuits.com> wrote in message
> news:ey%236Y56aIHA.4696@.TK2MSFTNGP05.phx.gbl...
>
> The Refresh button reloads the page in exactly the way that it was
> originally loaded... If it was originally loaded as a result of a
> postback, then hitting the Refresh button will cause it to be reloaded as
> from a postback...
> This is standard browser behaviour...
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
"Jonathan Wood" <jwood@.softcircuits.com> wrote in message
news:u5MixDCbIHA.4144@.TK2MSFTNGP05.phx.gbl...

> Thanks for putting me back on the right track.
You still persist in top-posting, though...
Mark Rae
ASP.NET MVP
http://www.markrae.net
Oh well.
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Mark Rae [MVP]" <mark@.markNOSPAMrae.net> wrote in message
news:eV7S8AFbIHA.3572@.TK2MSFTNGP02.phx.gbl...
> "Jonathan Wood" <jwood@.softcircuits.com> wrote in message
> news:u5MixDCbIHA.4144@.TK2MSFTNGP05.phx.gbl...
>
> You still persist in top-posting, though...
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
"Jonathan Wood" <jwood@.softcircuits.com> wrote in message
news:ex1KAdFbIHA.5348@.TK2MSFTNGP03.phx.gbl...

> Oh well.
Learning how to snip would be useful too...
Mark Rae
ASP.NET MVP
http://www.markrae.net

Singing out

I have a Sing In page which is responsible for checking user credentials.
if the result of checking the credentials is OK, the user will be directed to the Main (Home) Page.
If the user click Sing Out in the Main (Home) Page, the user will be directed to the Sing In Page.

The problem is , once the user have signed out and click Back Button in the browser she/he is still able to navigate to the previous pages.
How to avoid navigating back after singing out? Or (what is the best solution)

* I used session for authentication.

Regadrds

White Dove

Thats a good point. I never did notice it. Not sure but maybe setting the page with no cache will help?

Sign In Code:

// The following code is executed after you have gone through the database to find the user

string userName = "John";// You will use some method here like GetUserName(string email) which returns the userID

if(userName !=null && userName!= "")

{

// For the second parameter you can also use Checkbox value CheckBox1.Checked

FormsAuthentication.SetAuthCookie(txtUserName.Text,true);

Response.Redirect("RequestedPage.aspx");

}

Sign out Code:

FormsAuthentication.SignOut();

Response.Cookies["UserName"].Value =null;

// The date can be anything which has already passed

Response.Cookies["UserName"].Expires =new System.DateTime(1999,10,12);

Response.Redirect("Whateverpage.aspx");


oops..sorry, posted in the wrong page.

Single and Double Quotes in ASP.NET

Hi Everyone,

I have a DataGrid which contains various columns, one of which is an
image which comes from the data source. I'd like to bind the HTML
'alt' setting as well with text from the data source. A problem occurs
when the text in the data source has a single quote however.

For example, if the text in the data source is "John Doe's tractor",
only "John Doe" appears in the IMG tag. (The single quote terminated
the string.)

My code is below. I've played around with rearranging the quotes, but
no success. Does anyone know a way around this? (Incidentally, I even
tried changing "John Doe's" in my data source to John Doe's but
the result is the same.)

<ItemTemplate
<IMG alt='<%# DataBinder.Eval(Container.DataItem, "Description")%>'
src='<%# "thumbs/" + DataBinder.Eval(Container.DataItem,
"Snapshot")%>' width="100px"
</ItemTemplate
Thanks,
RogerRoger,

Try <IMG alt="<%# DataBinder.Eval(Container.DataItem, \"Description\")%>"

Eliyahu

"Roger Helliwell" <rhelliwell@.telus.net> wrote in message
news:d6ohe0pvnbeq61crh9tpfsffr5n11ihvj3@.4ax.com...
> Hi Everyone,
> I have a DataGrid which contains various columns, one of which is an
> image which comes from the data source. I'd like to bind the HTML
> 'alt' setting as well with text from the data source. A problem occurs
> when the text in the data source has a single quote however.
> For example, if the text in the data source is "John Doe's tractor",
> only "John Doe" appears in the IMG tag. (The single quote terminated
> the string.)
> My code is below. I've played around with rearranging the quotes, but
> no success. Does anyone know a way around this? (Incidentally, I even
> tried changing "John Doe's" in my data source to John Doe's but
> the result is the same.)
> <ItemTemplate>
> <IMG alt='<%# DataBinder.Eval(Container.DataItem, "Description")%>'
> src='<%# "thumbs/" + DataBinder.Eval(Container.DataItem,
> "Snapshot")%>' width="100px">
> </ItemTemplate>
> Thanks,
> Roger
Roger Helliwell wrote:
> Hi Everyone,
> I have a DataGrid which contains various columns, one of which is an
> image which comes from the data source. I'd like to bind the HTML
> 'alt' setting as well with text from the data source. A problem occurs
> when the text in the data source has a single quote however.
> For example, if the text in the data source is "John Doe's tractor",
> only "John Doe" appears in the IMG tag. (The single quote terminated
> the string.)
> My code is below. I've played around with rearranging the quotes, but
> no success. Does anyone know a way around this? (Incidentally, I even
> tried changing "John Doe's" in my data source to John Doe's but
> the result is the same.)
> <ItemTemplate>
> <IMG alt='<%# DataBinder.Eval(Container.DataItem, "Description")%>'
> src='<%# "thumbs/" + DataBinder.Eval(Container.DataItem,
> "Snapshot")%>' width="100px">
> </ItemTemplate>
> Thanks,
> Roger

Replace every single quote with ' on databinding:
<%# Replace(DataBinder.Eval(Container.DataItem,
"Description"),"'","'")%
--

Jos
On Mon, 5 Jul 2004 09:40:25 +0200 in
microsoft.public.dotnet.framework.aspnet, "Jos"
<josnospambranders@.fastmail.fm> wrote:

>Replace every single quote with ' on databinding:
><%# Replace(DataBinder.Eval(Container.DataItem,
>"Description"),"'","'")%
Makes sense in theory, but since I'm enclosing everything within
single quotes, the "'" string still causes a syntax error.
I did finally work out a solution though, although it's a hack. In my
Page_Load event, I iterate through all rows in my DataSet and replace
every single quote with "’" (That's the right-angled single
quote). It seems the <img alt> attribute doesn't seem to mind that.

Roger

Single and Double Quotes in ASP.NET

Hi Everyone,
I have a DataGrid which contains various columns, one of which is an
image which comes from the data source. I'd like to bind the HTML
'alt' setting as well with text from the data source. A problem occurs
when the text in the data source has a single quote however.
For example, if the text in the data source is "John Doe's tractor",
only "John Doe" appears in the IMG tag. (The single quote terminated
the string.)
My code is below. I've played around with rearranging the quotes, but
no success. Does anyone know a way around this? (Incidentally, I even
tried changing "John Doe's" in my data source to John Doe's but
the result is the same.)
<ItemTemplate>
<IMG alt='<%# DataBinder.Eval(Container.DataItem, "Description")%>'
src='<%# "thumbs/" + DataBinder.Eval(Container.DataItem,
"Snapshot")%>' width="100px">
</ItemTemplate>
Thanks,
RogerRoger,
Try <IMG alt="<%# DataBinder.Eval(Container.DataItem, \"Description\")%>"
Eliyahu
"Roger Helliwell" <rhelliwell@.telus.net> wrote in message
news:d6ohe0pvnbeq61crh9tpfsffr5n11ihvj3@.
4ax.com...
> Hi Everyone,
> I have a DataGrid which contains various columns, one of which is an
> image which comes from the data source. I'd like to bind the HTML
> 'alt' setting as well with text from the data source. A problem occurs
> when the text in the data source has a single quote however.
> For example, if the text in the data source is "John Doe's tractor",
> only "John Doe" appears in the IMG tag. (The single quote terminated
> the string.)
> My code is below. I've played around with rearranging the quotes, but
> no success. Does anyone know a way around this? (Incidentally, I even
> tried changing "John Doe's" in my data source to John Doe's but
> the result is the same.)
> <ItemTemplate>
> <IMG alt='<%# DataBinder.Eval(Container.DataItem, "Description")%>'
> src='<%# "thumbs/" + DataBinder.Eval(Container.DataItem,
> "Snapshot")%>' width="100px">
> </ItemTemplate>
> Thanks,
> Roger
>
Roger Helliwell wrote:
> Hi Everyone,
> I have a DataGrid which contains various columns, one of which is an
> image which comes from the data source. I'd like to bind the HTML
> 'alt' setting as well with text from the data source. A problem occurs
> when the text in the data source has a single quote however.
> For example, if the text in the data source is "John Doe's tractor",
> only "John Doe" appears in the IMG tag. (The single quote terminated
> the string.)
> My code is below. I've played around with rearranging the quotes, but
> no success. Does anyone know a way around this? (Incidentally, I even
> tried changing "John Doe's" in my data source to John Doe's but
> the result is the same.)
> <ItemTemplate>
> <IMG alt='<%# DataBinder.Eval(Container.DataItem, "Description")%>'
> src='<%# "thumbs/" + DataBinder.Eval(Container.DataItem,
> "Snapshot")%>' width="100px">
> </ItemTemplate>
> Thanks,
> Roger
Replace every single quote with ' on databinding:
<%# Replace(DataBinder.Eval(Container.DataItem,
"Description"),"'","'")%>
Jos
On Mon, 5 Jul 2004 09:40:25 +0200 in
microsoft.public.dotnet.framework.aspnet, "Jos"
<josnospambranders@.fastmail.fm> wrote:

>Replace every single quote with ' on databinding:
><%# Replace(DataBinder.Eval(Container.DataItem,
>"Description"),"'","'")%>
Makes sense in theory, but since I'm enclosing everything within
single quotes, the "'" string still causes a syntax error.
I did finally work out a solution though, although it's a hack. In my
Page_Load event, I iterate through all rows in my DataSet and replace
every single quote with "’" (That's the right-angled single
quote). It seems the <img alt> attribute doesn't seem to mind that.
Roger

Single Application -> Multiple Databases

We have a setup where we have a single web application, but the user can be
attached to any of a hundred different (identically structured) databases
depending on their login credentials.

Currently we are storing the connection string in Session and in each page's
Page_Init we reset any SqlDataSource's connection string. This works
reasonably well, though not ideal:
SqlDataSource1.ConnectionString = Session("dbconn")

I would like to start experimenting with creating a full data access layer
using an ObjectDataSource and bound controls. This is easy enough to set up
after following the tutorials on www.asp.net and I added the DataSet/XSD,
but I do not see a way to set the underlying connection string. It is
pulling the original connection string from web.config. I don't see a class
file that I can edit and I can't access the properties of the DAL through
the ObjectDataSource.

Any idea how I can accomplist this?

Thanks."David W" <spivey@.nospam.post.comwrote in message
news:u%23mL3IBGIHA.4296@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

We have a setup where we have a single web application, but the user can
be attached to any of a hundred different (identically structured)
databases depending on their login credentials.


Any particular reason for this structure, AAMOI...?

Quote:

Originally Posted by

Currently we are storing the connection string in Session and in each
page's Page_Init we reset any SqlDataSource's connection string. This
works reasonably well, though not ideal:
SqlDataSource1.ConnectionString = Session("dbconn")
>
I would like to start experimenting with creating a full data access layer
using an ObjectDataSource and bound controls. This is easy enough to set
up after following the tutorials on www.asp.net and I added the
DataSet/XSD, but I do not see a way to set the underlying connection
string. It is pulling the original connection string from web.config. I
don't see a class file that I can edit and I can't access the properties
of the DAL through the ObjectDataSource.


I guess it would depend on the backend RDBMS. If it's SQL Server, I would go
for the factory pattern described in Microsoft's DAAB:
http://www.dotnetjunkies.com/Articl...87F100A9F9.dcik
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
//SqlDataSource1.ConnectionString = Session("dbconn")//

Ahhh.....

Just stored the connection string NAME... as the most recent picked item

{
ConnectionStringSettingsCollection connectionStrings =
ConfigurationManager.ConnectionStrings;

ConnectionStringSettings connection;
foreach ( connection in connectionStrings) {

string connectionStringName = connection.Name;
string connectionString = connection.ConnectionString;
string providerName = connection.ProviderName;

Debug.Print(connectionStringName);
}

this.GridView1.DataSource = connectionStrings;
this.GridView1.DataBind();
}

Get rid of those stupid "auto generated adapters" (FillTable) things when
you create your Strong DataSet.
Those things are the devil.

You can get something like the EnterpriseLibrary.Data to help if you want.
Either way, write a real DAL object ... which will populate your strong
dataset... and pull the connection string info from the config file, using
the simple NAME passed into your DAL object.

That auto generated stuff is for the birds, esp when you want to pick the
database dynamically.

class ZebraData
{
public static ZebraStrongDS GetAllZebras( string connectionStringName ,
string zebraColor )
{
//pull the connection string from the config file with the objects above
//
ZebraStrongDS returnDS = new ZebraStrongDS ();

// i threw in zebraColor as a param...
//call LoadDataSet method here, to populate the returnDS with
resultset(s) from a stored procedure or something

}

}

You can check my blog, I have several NLayered (and now 1 NTiered example)
there:
http://sholliday.spaces.live.com/Blog/
"David W" <spivey@.nospam.post.comwrote in message
news:u%23mL3IBGIHA.4296@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

We have a setup where we have a single web application, but the user can
be attached to any of a hundred different (identically structured)
databases depending on their login credentials.
>
Currently we are storing the connection string in Session and in each
page's Page_Init we reset any SqlDataSource's connection string. This
works reasonably well, though not ideal:
SqlDataSource1.ConnectionString = Session("dbconn")
>
I would like to start experimenting with creating a full data access layer
using an ObjectDataSource and bound controls. This is easy enough to set
up after following the tutorials on www.asp.net and I added the
DataSet/XSD, but I do not see a way to set the underlying connection
string. It is pulling the original connection string from web.config. I
don't see a class file that I can edit and I can't access the properties
of the DAL through the ObjectDataSource.
>
Any idea how I can accomplist this?
>
Thanks.
>
>
>
>


"Mark Rae [MVP]" <mark@.markNOSPAMrae.netwrote in message
news:eDTuEQBGIHA.4956@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

"David W" <spivey@.nospam.post.comwrote in message
news:u%23mL3IBGIHA.4296@.TK2MSFTNGP04.phx.gbl...
>

Quote:

Originally Posted by

>We have a setup where we have a single web application, but the user can
>be attached to any of a hundred different (identically structured)
>databases depending on their login credentials.


>
Any particular reason for this structure, AAMOI...?
>


By law (HIPAA), for performace (smaller tables and multiple servers),
management (easier to move around databases to different servers as needed,
backups, restores, etc.), security (separate logins for each database, and
no chance of accidental crossover (easier row level security). Each
customer has their own database and there is no crossover (other than some
lookup tables that get pushed to every database each release) so it works
out very well in our situation. There is one base database that stores the
location of each database for each customer.

Yes, its SQL Server 2005 Standard.

I'll look at that appication block, but I don't think that ties in directly
to the DAL from looking at it.

-Dave
"David W" <spivey@.nospam.post.comwrote in message
news:eXlZHwBGIHA.4712@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

I'll look at that appication block, but I don't think that ties in
directly to the DAL from looking at it.


That's precisely what it is:
http://msdn.microsoft.com/msdnmag/i.../07/DataPoints/
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Single asp script without ddl files etc.

I have a rather silly question: I have been trained in both ASP.NET aswell as PHP and was wondering if ASP.NET always has to be compiled intoa project etc. to be implimented. Let me illustrate:
Say I have a completely static website, nothing but XHMTL and CSS,however I have a contact form that needs to be submitted in an htmlmail for some reason, thus some coding is required (this is a randomexample, I could as well have said I want a counter on the front pageto increment a value in the database)
Now I was wondering if it is possible to impliment asp.net just forthat page, like you would do in php. all the other files would benormal html files, but the contact form one then would be contact.php(or at least the action would go to a php file). So is it possible tosend the form to an asp.net script or to implement some asp.net in themiddle of a page without builing a project and thus having to convertall html pages to aspx?
I hope this is clear, i'm basically asking if I can implement asp.net as loosely as PHP and if so, how?
Many thanks!
Sure, you can have just one page in your application be in asp.net (.aspx file), and the rest be HTML files.
Marcie
ASP, ASP.NET, ASP.NET 2.0, PHP, ColdFusion, they are all controlled through ISAPI filters. You dont enable asp on a file level. It runs for a "site" which adds the ISAPI filter to instruct IIS what to do, when it comes across a file with an aspx extension.
It should work no differently than PHP does when it comes across a file with a .php extension. IIS doesnt know or care, it's the compiled framework that then renders your "coded" pages into html pages to send to the browser.
Hope that helps.

Thanks for replying guys! Yeah it does help, but I do suppose that Ihave to write all the code in line then in script blocks? Nocode-behind and such?

You can still use code-behind, the only files VS.NET will compile up for you will be the ASPX page, the HTML pages will still be just that.
Marcie

Single Cell In Excel

Hi Everyone,

I don't know how to set a single cell for 2 different colors. For example, ' * Required Field ' which '*' is color red and 'Required Field' is color black.

please help...If you need to use activex automation i.e. VBA, then the following should do it (else look below)

Range("F10").Select
ActiveCell.FormulaR1C1 = "* Required Field"
With ActiveCell.Characters(Start:=1, Length:=1).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 46
End With
With ActiveCell.Characters(Start:=3, Length:=14).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Range("F10").Select

if you need to do it using the visual gui in Excel you can do it by going into the edit mode of the cell, selecting the text individually and changing the formatting of the font.
thanks Manasvin. i try it out and solve the problem already. its really work.
You don't want to do office automation for a web page though. It's not going to scale well. One possibility is to create some html that is formatted correctly in a table, and return that HTML as an Excel file. Excel will accept the format correctly.

Alternatively, if you can support later versions of Excel (2002), you can use XML instead.
hallo oog,

how to return the HTML (table formatted) as an Excel file. Can you give me a example how to implement it.

thanks

Single DLL - How to get rid of ASPX files?

I'm using a Web Deployment Project under Visual Studio 2005.
What I would love to be able to deploy to a fresh server is just the \bin
folder and the web.config (and perhaps a couple of other support files). But
essentially I don't want to have to deploy all the ASPXs, images, .js etc.
Is there a way to achieve this?
I seem to remember some sort of special ASP.NET marker file you could put in
the application root which would tell it to get all the ASPX content from th
e
DLL. Did I dream it?
Thanks,
- Boris YThe ASPX files, with a dll compile, are placeholders. If they are not there,
you get a 404. If they are, the DLL has smarts to find the pointer in code.
It is an unfortunate side effect. AFAIK, if you want to completely get rid
of them, you would need to create your own handler that redirects the 404.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
****************************************
*********
Think outside of the box!
****************************************
*********
"Boris Yeltsin" <borisy@.nospam.nospam> wrote in message
news:2A7E1017-7FDA-41C9-A155-B792A50355F7@.microsoft.com...
> I'm using a Web Deployment Project under Visual Studio 2005.
> What I would love to be able to deploy to a fresh server is just the \bin
> folder and the web.config (and perhaps a couple of other support files).
> But
> essentially I don't want to have to deploy all the ASPXs, images, .js etc.
> Is there a way to achieve this?
> I seem to remember some sort of special ASP.NET marker file you could put
> in
> the application root which would tell it to get all the ASPX content from
> the
> DLL. Did I dream it?
> Thanks,
> - Boris Y
"Boris Yeltsin" wrote:
> What I would love to be able to deploy to a fresh server is just the \bin
> folder and the web.config (and perhaps a couple of other support files). B
ut
> essentially I don't want to have to deploy all the ASPXs, images, .js etc.
> Is there a way to achieve this?
Yes, open a command prompt and cd to your 2.0 framework folder (something
like C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727) and use
aspnet_compiler.exe, like this:
aspnet_compiler.exe -v /VirtualDirName -p C:\ProjectPath C:\OutputFolder
You can then copy the contents of C:\OutputFolder to the virtual directory
/VirtualDirName on your IIS server. Remember to make sure the virtual
directory is set to use v2 of the .net framework, or you'll just get
placeholder text (as all the aspx files still exists, they are just blank)
OK, this is similar to the standard publish function. It's almost there thou
gh.
Some issues:
1) There are assemblies (DLLs) for each file in the bin folder, not just a
single DLL for the web site
2) My external resources (Images, JavaScript files) are not compiled into
the DLL
So, if we can find solutions to these, we'll be rocking!
Thank you,
- Boris Y
"Leon Mayne" wrote:

> "Boris Yeltsin" wrote:
> Yes, open a command prompt and cd to your 2.0 framework folder (something
> like C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727) and use
> aspnet_compiler.exe, like this:
> aspnet_compiler.exe -v /VirtualDirName -p C:\ProjectPath C:\OutputFolder
> You can then copy the contents of C:\OutputFolder to the virtual directory
> /VirtualDirName on your IIS server. Remember to make sure the virtual
> directory is set to use v2 of the .net framework, or you'll just get
> placeholder text (as all the aspx files still exists, they are just blank)
>
the default compile is a dll per page. ms has a utility to merge them into
one dll. you can get rid of images by inserting them into a resource, and
changing all reference to a resource reference (though there is a
performance cost for having asp.net serve images rather than iis)
-- bruce (sqlwork.com)
"Boris Yeltsin" <borisy@.nospam.nospam> wrote in message
news:173C5915-8132-4123-B278-E1DE6B83B345@.microsoft.com...
> OK, this is similar to the standard publish function. It's almost there
> though.
> Some issues:
> 1) There are assemblies (DLLs) for each file in the bin folder, not just a
> single DLL for the web site
> 2) My external resources (Images, JavaScript files) are not compiled into
> the DLL
> So, if we can find solutions to these, we'll be rocking!
> Thank you,
> - Boris Y
> "Leon Mayne" wrote:
>
OK, let's take this one step at a time. We'll worry about the resource file
issue afterwards.
I've run:
aspnet_compiler.exe -v /VirtualDirName -p C:\ProjectPath C:\OutputFolder
So now I have a project which has no ASPX files, a whole lot of .dll and a
whole lot of .compiled files in the \bin folder. Works great.
So, now I run:
aspnet_merge.exe C:\OutputFolder -o MyProject
And that creates a single .dll from all the .dll files in the \bin.
I still have a huge supply of .compiled files in the \bin though (one for
every ASPX).
What can I do about these?
Thanks,
Boris Y
Hi Boris,
The .Compiled file is a marker file for each page and control in the Web
site and identifies the class used inside of the assembly. These files are
not optional as they map the ASPX pages to the appropriate precompiled
classes in the precompiled assemblies. If you remove the .Compiled file,
the page that it maps will not be able to execute and you get an execution
error.
However, you could remove the .ASPX file marker file if you're not using
Windows Authentication. If you need to set specific Windows file rights on
a directory or specific file, an actual file must exist in order for
Windows Authentication to work. If you don't use Windows Authentication in
your Web application, these marker files can be removed and you can run
entirely off the files in the BIN directory.
You can find an excellent article about ASP.NET Compilation and Deployment
here:
#Compilation and Deployment in ASP.NET 2.0
http://west-wind.com/presentations/...Compilation.asp
Please let me know if you need further information about this or how to
embed resource files and javascript files in your assembly too.
Sincerely,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...t/default.aspx.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks for the reply and explanation Walter.
I'm not using Windows Auth, so I've removed all the ASPX files and am just
left with all the external resources (CSS, JS, images etc).
If I used embedded resource files, would the output be cachable so that it
wouldn't have to be processed through the entire ASP.NET chain on every
request?
I'm cautious about changing something which is just a very simple static
file into something that could massively increase IIS overheads.
Let me know...
Many thanks,
Boris Y
"Walter Wang [MSFT]" wrote:

> Hi Boris,
> The .Compiled file is a marker file for each page and control in the Web
> site and identifies the class used inside of the assembly. These files are
> not optional as they map the ASPX pages to the appropriate precompiled
> classes in the precompiled assemblies. If you remove the .Compiled file,
> the page that it maps will not be able to execute and you get an execution
> error.
> However, you could remove the .ASPX file marker file if you're not using
> Windows Authentication. If you need to set specific Windows file rights on
> a directory or specific file, an actual file must exist in order for
> Windows Authentication to work. If you don't use Windows Authentication in
> your Web application, these marker files can be removed and you can run
> entirely off the files in the BIN directory.
> You can find an excellent article about ASP.NET Compilation and Deployment
> here:
> #Compilation and Deployment in ASP.NET 2.0
> http://west-wind.com/presentations/...Compilation.asp
> Please let me know if you need further information about this or how to
> embed resource files and javascript files in your assembly too.
> Sincerely,
> Walter Wang (wawang@.online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> ========================================
==========
> Get notification to my posts through email? Please refer to
> [url]http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif[/ur
l]
> ications. If you are using Outlook Express, please make sure you clear the
> check box "Tools/Options/Read: Get 300 headers at a time" to see your repl
y
> promptly.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscript...t/default.aspx.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
Hi Boris,
The embedded web resource will be cached. You can find more information
here (look for the "Perf" section):
#Nikhil Kothari's Weblog : Whats with System.Web.UI.WebResourceAttribute
http://www.nikhilk.net/WebResourceAttribute.aspx
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
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.
Thanks Walter, Nikhil's page was very helpful.
My next question is this:
All the examples of using WebResource seem to imply that you need to create
a separate Class Library project for the resources.
Currently I'm using the "Web Site Project" model.
Is there anything I can do from the UI or even from custom build flags etc
that would allow me to simply embed the resources I already have in the
project?
e.g. I just have a file in the root of the web project called "logo.gif".
And I want that to stay in the project but get compiled in as a resource
which I could then refer to as WebResource("MyWebProject.logo.gif").
Let me know...
Thanks,
Boris
"Walter Wang [MSFT]" wrote:

> Hi Boris,
> The embedded web resource will be cached. You can find more information
> here (look for the "Perf" section):
> #Nikhil Kothari's Weblog : Whats with System.Web.UI.WebResourceAttribute
> http://www.nikhilk.net/WebResourceAttribute.aspx
> Regards,
> Walter Wang (wawang@.online.microsoft.com, remove 'online.')
> 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
.
>