Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Saturday, March 31, 2012

Separate code file

Hi

I have a button on a webform. When I double click the button to create click
event it is created in the same file (aspx). How can I tell vs2005 to create
the code in a separate aspx.vb file?

Thanks

RegardsOn Feb 19, 4:54 am, "John" <J...@.nospam.infovis.co.ukwrote:

Quote:

Originally Posted by

Hi
>
I have a button on a webform. When I double click the button to create click
event it is created in the same file (aspx). How can I tell vs2005 to create
the code in a separate aspx.vb file?
>
Thanks
>
Regards


You enable the ASP .NET code-behind feature by adding attributes to
the @.Page directive.

for VB

<%@. Page Language="VB" Inherits="myClass" CodeBehind="myPage.aspx.vb"
%>

for C#

<%@. Page Language="C#" Inherits="myClass" CodeBehind="myPage.aspx.cs"
%>
Does that mean that it is not something one should normally be doing
otherwise it would have been provided by default?

Thanks

Regards

"Alexey Smirnov" <alexey.smirnov@.gmail.comwrote in message
news:1171872789.521209.303890@.v45g2000cwv.googlegr oups.com...

Quote:

Originally Posted by

On Feb 19, 4:54 am, "John" <J...@.nospam.infovis.co.ukwrote:

Quote:

Originally Posted by

>Hi
>>
>I have a button on a webform. When I double click the button to create
>click
>event it is created in the same file (aspx). How can I tell vs2005 to
>create
>the code in a separate aspx.vb file?
>>
>Thanks
>>
>Regards


>
You enable the ASP .NET code-behind feature by adding attributes to
the @.Page directive.
>
for VB
>
<%@. Page Language="VB" Inherits="myClass" CodeBehind="myPage.aspx.vb"
%>
>
for C#
>
<%@. Page Language="C#" Inherits="myClass" CodeBehind="myPage.aspx.cs"
%>
>


On Feb 19, 3:56 pm, "John" <J...@.nospam.infovis.co.ukwrote:

Quote:

Originally Posted by

Does that mean that it is not something one should normally be doing
otherwise it would have been provided by default?
>


VS creates that by default, when you add a new WebForm into project.
How do you created it?
Hi

I suspect I copied from another predone webform. I have now added this line
at the top;

<%@. Page Language="VB" MasterPageFile="MyMaster.master"
AutoEventWireup="false" CodeFile="MyPage.aspx.vb"
Inherits="Events_Settings_MyPage" Title="My Title" %>

and it says 'file '/Events/Settings/MyPage.aspx.vb' does not exist.' which
of course is true as the page did not have code behind to start with. How
can I now get vs to create the MyPage.aspx.vb file and link to the webform?

Thanks

Regards

"Alexey Smirnov" <alexey.smirnov@.gmail.comwrote in message
news:1171897535.364021.46260@.l53g2000cwa.googlegro ups.com...

Quote:

Originally Posted by

On Feb 19, 3:56 pm, "John" <J...@.nospam.infovis.co.ukwrote:

Quote:

Originally Posted by

>Does that mean that it is not something one should normally be doing
>otherwise it would have been provided by default?
>>


>
VS creates that by default, when you add a new WebForm into project.
How do you created it?
>


On Feb 19, 5:25 pm, "John" <J...@.nospam.infovis.co.ukwrote:

Quote:

Originally Posted by

Hi
>
I suspect I copied from another predone webform. I have now added this line
at the top;
>


Well, I think the best way is to add a new webform to your project. VS
will create aspx and the one for code-behind. Then you can copy your
code to this new webform, or use created code-behind *.vb as an
example.

Separate code file

Hi
I have a button on a webform. When I double click the button to create click
event it is created in the same file (aspx). How can I tell vs2005 to create
the code in a separate aspx.vb file?
Thanks
RegardsOn Feb 19, 4:54 am, "John" <J...@.nospam.infovis.co.uk> wrote:
> Hi
> I have a button on a webform. When I double click the button to create cli
ck
> event it is created in the same file (aspx). How can I tell vs2005 to crea
te
> the code in a separate aspx.vb file?
> Thanks
> Regards
You enable the ASP .NET code-behind feature by adding attributes to
the @.Page directive.
for VB
<%@. Page Language="VB" Inherits="myClass" CodeBehind="myPage.aspx.vb"
%>
for C#
<%@. Page Language="C#" Inherits="myClass" CodeBehind="myPage.aspx.cs"
%>
Does that mean that it is not something one should normally be doing
otherwise it would have been provided by default?
Thanks
Regards
"Alexey Smirnov" <alexey.smirnov@.gmail.com> wrote in message
news:1171872789.521209.303890@.v45g2000cwv.googlegroups.com...
> On Feb 19, 4:54 am, "John" <J...@.nospam.infovis.co.uk> wrote:
> You enable the ASP .NET code-behind feature by adding attributes to
> the @.Page directive.
> for VB
> <%@. Page Language="VB" Inherits="myClass" CodeBehind="myPage.aspx.vb"
> %>
> for C#
> <%@. Page Language="C#" Inherits="myClass" CodeBehind="myPage.aspx.cs"
> %>
>
On Feb 19, 3:56 pm, "John" <J...@.nospam.infovis.co.uk> wrote:
> Does that mean that it is not something one should normally be doing
> otherwise it would have been provided by default?
>
VS creates that by default, when you add a new WebForm into project.
How do you created it?
Hi
I suspect I copied from another predone webform. I have now added this line
at the top;
<%@. Page Language="VB" MasterPageFile="MyMaster.master"
AutoEventWireup="false" CodeFile="MyPage.aspx.vb"
Inherits="Events_Settings_MyPage" Title="My Title" %>
and it says 'file '/Events/Settings/MyPage.aspx.vb' does not exist.' which
of course is true as the page did not have code behind to start with. How
can I now get vs to create the MyPage.aspx.vb file and link to the webform?
Thanks
Regards
"Alexey Smirnov" <alexey.smirnov@.gmail.com> wrote in message
news:1171897535.364021.46260@.l53g2000cwa.googlegroups.com...
> On Feb 19, 3:56 pm, "John" <J...@.nospam.infovis.co.uk> wrote:
> VS creates that by default, when you add a new WebForm into project.
> How do you created it?
>
On Feb 19, 5:25 pm, "John" <J...@.nospam.infovis.co.uk> wrote:
> Hi
> I suspect I copied from another predone webform. I have now added this lin
e
> at the top;
>
Well, I think the best way is to add a new webform to your project. VS
will create aspx and the one for code-behind. Then you can copy your
code to this new webform, or use created code-behind *.vb as an
example.

Thursday, March 29, 2012

Sepcify browser to launch with on VS 2008

Hi

I know I'm being stupid but how can I specify what browser gets launched
when I start debugging in VS2008. At the moment Firefox gets launched even
though IE7 is my default browser. This means that my javascript debugging
isnt working although I can debug in firebug I want to do it all from the
IDE.

Many thanks

ErikWith default browser do you mean that when right-clicking an aspx file in
VS2008 and picking Browse With...you have set IE as default browser there?
That controls which browser is opened when you press F5

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"Erik Nodland" <erik@.gotaabejoking.comwrote in message
news:572DF19C-DD8F-460C-A6EB-51CCEEEC5DC3@.microsoft.com...

Quote:

Originally Posted by

Hi
>
I know I'm being stupid but how can I specify what browser gets launched
when I start debugging in VS2008. At the moment Firefox gets launched even
though IE7 is my default browser. This means that my javascript debugging
isnt working although I can debug in firebug I want to do it all from the
IDE.
>
Many thanks
>
Erik
>
>

Monday, March 26, 2012

Serche box on my site

Hi!

I would like to ad a serchbox to my site, s? others can serche on my site. Do someone knows how I can make one myself? Or maybe you know some good easy tutorials for that?

Thanks

from Sanne

here you can find some article abut searching :

http://www.codeproject.com/info/search.asp?cats=4&searchkw=search&Submit1=Search&author=&sd=11%2F15%2F1999&ed=4%2F4%2F2005


Hi Sanne,

been a long time I saw you around here.

A tutorial could be:Searching Your Website with Microsoft Index Services

Grz, Kris.


Hi Kris!

Thanks a lot for the very good tutorial to make a serchebox to my site! I read about it, and i′m going to try it out to morrow when I′m at work.

Nice of you to notice that I haven′t visit asp.net forums for some time! :-) Nice to be remembered from someone!

Hugs from Sanne


Hi,

of course I remembered youCool [H].

Another thing: you could download the code from this book:ASP.NET 1.1 Solutions Toolkit

I found an example of it as pdf file somewhere on the internet but can't remember where (ok, that's the kind of stuff I do forgetCrying [:'(]). It included chapter 13 & 14.

Grz, Kris.


Hi Kris!

I didn′t get the files from easysearchasp.net, i added my namen and my email adres, but they didn′t send me any files to the searchbox. So I started to do the tutorial: Searching your website with Microsoft index services, but i din′t get so far...

In the tutorial they told me to go to Microsft managment console, is that the control panel they mean? Next it say that i shoul open Indexing service snap-in...that i don′t know what they mean, do you?

It is the tutorial you offered me to use:

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

I realy need to make one searchbox to my site, so if you maybe can help me a little bit more I should be verry happy! :-)

Thanks.

Hugs from Sanne


Hi Sanne,

are you using 2 profiles on these forums?

If you can host your solution on a server that you're managing then you could use the technique of indexing services. If not you're going to have to look with a big, charming smile at your hosting companySmile [:)]. Not a problem for you I guessWink [;)].

Indexing services can be found under the configuration of windows | systemmanagement | click computermanagement and there find the Services and applications, click the + sign and discover the Indexing-service. Be aware that I had to translate it from my native language to English so I don't really know if all the descriptions are correctGeeked [8-|].

Grz, Kris.


Hi Kris!

Yes, i do, only because i forget my password when I when to work one day. Yes I know now how I come in there in the indexing service. But I really understand how to index my text from my site. In the tutorial they explain that i should do a new catalog. S? I right clikc on the indexing servcie text and made one new and chose a place in my computer where i should save it...but shouldn′t i chose my webpages somewhere...sorry I′m little bit confused...*ler*...sometimes it′s hard to do somethings you haven′t done before...

hugs from Sanne


Hi,

you can request your password when you forgot it. Just let it be sent to your emailaddress.

Actually, I didn't follow the tutorial myself and I also don't have that much experience with indexing services myself. Yes sometimes it's difficult to try something new but that's just the beauty of programmingCool [H].

Grz, Kris.


Hi Kris!

It′s fun to try to learn new stuff, so i think I have to try a little bit more to dom this indexing service. Thanks for all support!

Hugs from Sanne

Saturday, March 24, 2012

Serializing an object from HttpApplicationState

Hi!
I have an object stored in the HttpApplicationState collection of my
site, but i would like to mantain the state of this object even if the
application restart, so in case of any problem or when I change
something in the web.config or add anything to the bin directory, i can
load the last values from somewhere and continue the work.
I'm using serialization to accomplish this, and it works ok. But i'm
serializing the object to a file in the "HttpApplication.EndRequest"
event. The problem is that with this event, it saves the file in the end
of every instance of HttpApplication, which occours almost every second.
I tested locally, and it saves the file everytime i access any page.
I know that the HttpApplicationState is shared among all the instances
of HttpApplication, and I would like to save the file only before
ApplicationState is destroyed, not the application...
There is no event in HttpApplicationState, so is there any way of doing
this?
Thanks in advance.Hi Natan:
One of the safest things you could do is re-save the file anytime the
value changes (if it is not changing too frequently). This would take
care of even catostrophic failures.
There is an Application_End method you can use in the code behind for
Global.asax. This method should fire whenever the application shuts
down or recycles.
Scott
http://www.OdeToCode.com
On Sun, 26 Sep 2004 19:06:03 -0300, Natan <nvivo@.mandic.com.br> wrote:

>Hi!
>I have an object stored in the HttpApplicationState collection of my
>site, but i would like to mantain the state of this object even if the
>application restart, so in case of any problem or when I change
>something in the web.config or add anything to the bin directory, i can
>load the last values from somewhere and continue the work.
>I'm using serialization to accomplish this, and it works ok. But i'm
>serializing the object to a file in the "HttpApplication.EndRequest"
>event. The problem is that with this event, it saves the file in the end
>of every instance of HttpApplication, which occours almost every second.
>I tested locally, and it saves the file everytime i access any page.
>I know that the HttpApplicationState is shared among all the instances
>of HttpApplication, and I would like to save the file only before
>ApplicationState is destroyed, not the application...
>There is no event in HttpApplicationState, so is there any way of doing
>this?
>
>Thanks in advance.
Scott Allen wrote:
> Hi Natan:
> One of the safest things you could do is re-save the file anytime the
> value changes (if it is not changing too frequently). This would take
> care of even catostrophic failures.
That's what i would like to avoid. File writes are too expensive, and
this would be like 3 or 4 per second. although the file size is aprox.
20k, it is still unnecessary.

> There is an Application_End method you can use in the code behind for
> Global.asax. This method should fire whenever the application shuts
> down or recycles.
Application_End is tied to the EndRequest actually, which is not the
Application in IIS itself, but HttpApplication instance. Many instances
are created and destroyed everytime by the server... take a look at the
documentation.
I really would like to save it only when necessary. Maybe i'll need to
implement it in another way...
Hi Natan:

>Application_End is tied to the EndRequest actually, which is not the
>Application in IIS itself, but HttpApplication instance. Many instances
>are created and destroyed everytime by the server... take a look at the
>documentation.
>
Negative: Application_EndRequest fires as the last event in the
pipeline before the request moves to the HttpHandler for the requested
resource. This happens on every request. Furthermore, the
HttpApplication instance is not destroyed, but is kept in a pool to
service another request.
Application_End, like Application_Start, is invoked only once, and
only invoked on a single HttpApplication instance, the first instance
in the pool. It will fire before the application domain unloads,
although there is some evidence that this behavior is not 100.00%
reliable.
I've been through the documentation many times, but even better I have
code that can demonstrate this behavior. You can watch the output
window of the debugger as you make requests to the web app with the
following code in global. Do an IISRESET to watch Application_End
fire.
public Global()
{
InitializeComponent();
id = System.Threading.Interlocked.Increment(ref counter);
}
protected void Application_Start(Object sender, EventArgs e)
{
Debug.WriteLine("Application_Start on ID: " + id.ToString());
}
protected void Application_EndRequest(Object sender, EventArgs e)
{
Debug.WriteLine("Application_EndRequest on ID: " + id.ToString());
}
protected void Application_End(Object sender, EventArgs e)
{
Debug.WriteLine("Application_End on ID: " + id.ToString());
}
static int counter = 0;
int id = 0;
Hope this helps,
Scott
http://www.OdeToCode.com
Scott Allen wrote:
> Negative: Application_EndRequest fires as the last event in the
> pipeline before the request moves to the HttpHandler for the requested
> resource. This happens on every request. Furthermore, the
> HttpApplication instance is not destroyed, but is kept in a pool to
> service another request.
> Application_End, like Application_Start, is invoked only once, and
> only invoked on a single HttpApplication instance, the first instance
> in the pool. It will fire before the application domain unloads,
> although there is some evidence that this behavior is not 100.00%
> reliable.
Hmmm... thanks. The sdk documentation has some wrong links.
Anyway, the problem with Application_End is that the applicationstate
object is already destroyed, so I can't use it...
=/
Hi Scott!
Suddenly I had the brilliant idea of creating a destructor for my object
(duh... why didn't i thought about it before?), and applying a singleton
pattern for it, so there is only one instance of it and when it is
destroyed, no matter where he is, it serializes itself to the file. When
the application restarts it checks for the file and load the state again.
Thanks anyway!

Serializing an object from HttpApplicationState

Hi!

I have an object stored in the HttpApplicationState collection of my
site, but i would like to mantain the state of this object even if the
application restart, so in case of any problem or when I change
something in the web.config or add anything to the bin directory, i can
load the last values from somewhere and continue the work.

I'm using serialization to accomplish this, and it works ok. But i'm
serializing the object to a file in the "HttpApplication.EndRequest"
event. The problem is that with this event, it saves the file in the end
of every instance of HttpApplication, which occours almost every second.
I tested locally, and it saves the file everytime i access any page.

I know that the HttpApplicationState is shared among all the instances
of HttpApplication, and I would like to save the file only before
ApplicationState is destroyed, not the application...

There is no event in HttpApplicationState, so is there any way of doing
this?

Thanks in advance.Hi Natan:

One of the safest things you could do is re-save the file anytime the
value changes (if it is not changing too frequently). This would take
care of even catostrophic failures.

There is an Application_End method you can use in the code behind for
Global.asax. This method should fire whenever the application shuts
down or recycles.

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

On Sun, 26 Sep 2004 19:06:03 -0300, Natan <nvivo@.mandic.com.br> wrote:

>Hi!
>I have an object stored in the HttpApplicationState collection of my
>site, but i would like to mantain the state of this object even if the
>application restart, so in case of any problem or when I change
>something in the web.config or add anything to the bin directory, i can
>load the last values from somewhere and continue the work.
>I'm using serialization to accomplish this, and it works ok. But i'm
>serializing the object to a file in the "HttpApplication.EndRequest"
>event. The problem is that with this event, it saves the file in the end
>of every instance of HttpApplication, which occours almost every second.
>I tested locally, and it saves the file everytime i access any page.
>I know that the HttpApplicationState is shared among all the instances
>of HttpApplication, and I would like to save the file only before
>ApplicationState is destroyed, not the application...
>There is no event in HttpApplicationState, so is there any way of doing
>this?
>
>Thanks in advance.
Scott Allen wrote:
> Hi Natan:
> One of the safest things you could do is re-save the file anytime the
> value changes (if it is not changing too frequently). This would take
> care of even catostrophic failures.

That's what i would like to avoid. File writes are too expensive, and
this would be like 3 or 4 per second. although the file size is aprox.
20k, it is still unnecessary.

> There is an Application_End method you can use in the code behind for
> Global.asax. This method should fire whenever the application shuts
> down or recycles.

Application_End is tied to the EndRequest actually, which is not the
Application in IIS itself, but HttpApplication instance. Many instances
are created and destroyed everytime by the server... take a look at the
documentation.

I really would like to save it only when necessary. Maybe i'll need to
implement it in another way...
Hi Natan:

>Application_End is tied to the EndRequest actually, which is not the
>Application in IIS itself, but HttpApplication instance. Many instances
>are created and destroyed everytime by the server... take a look at the
>documentation.

Negative: Application_EndRequest fires as the last event in the
pipeline before the request moves to the HttpHandler for the requested
resource. This happens on every request. Furthermore, the
HttpApplication instance is not destroyed, but is kept in a pool to
service another request.

Application_End, like Application_Start, is invoked only once, and
only invoked on a single HttpApplication instance, the first instance
in the pool. It will fire before the application domain unloads,
although there is some evidence that this behavior is not 100.00%
reliable.

I've been through the documentation many times, but even better I have
code that can demonstrate this behavior. You can watch the output
window of the debugger as you make requests to the web app with the
following code in global. Do an IISRESET to watch Application_End
fire.

public Global()
{
InitializeComponent();
id = System.Threading.Interlocked.Increment(ref counter);
}

protected void Application_Start(Object sender, EventArgs e)
{
Debug.WriteLine("Application_Start on ID: " + id.ToString());
}

protected void Application_EndRequest(Object sender, EventArgs e)
{
Debug.WriteLine("Application_EndRequest on ID: " + id.ToString());
}

protected void Application_End(Object sender, EventArgs e)
{
Debug.WriteLine("Application_End on ID: " + id.ToString());
}

static int counter = 0;
int id = 0;

Hope this helps,

--
Scott
http://www.OdeToCode.com
Scott Allen wrote:
> Negative: Application_EndRequest fires as the last event in the
> pipeline before the request moves to the HttpHandler for the requested
> resource. This happens on every request. Furthermore, the
> HttpApplication instance is not destroyed, but is kept in a pool to
> service another request.
> Application_End, like Application_Start, is invoked only once, and
> only invoked on a single HttpApplication instance, the first instance
> in the pool. It will fire before the application domain unloads,
> although there is some evidence that this behavior is not 100.00%
> reliable.

Hmmm... thanks. The sdk documentation has some wrong links.

Anyway, the problem with Application_End is that the applicationstate
object is already destroyed, so I can't use it...

=/
Hi Scott!

Suddenly I had the brilliant idea of creating a destructor for my object
(duh... why didn't i thought about it before?), and applying a singleton
pattern for it, so there is only one instance of it and when it is
destroyed, no matter where he is, it serializes itself to the file. When
the application restarts it checks for the file and load the state again.

Thanks anyway!

Tuesday, March 13, 2012

Server Application Error: The server failed to load application /LM/W3SVC.

Hi:

I was working good with IIS 5.0 and Netframework, but suddenly my Explorer gave this error: Server Application Error, and tell me to go to the event viewer for more details, who says this: The server failed to load application '/LM/W3SVC'.
For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

But there's nothing over there about my problem.

I will appreciate any help that you can give me.

Thanks...Hi,

did a quickgoogle search and came up with this:

PRB: Configured Identity Is Incorrect for IWAM Account.

Grz, Kris.