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

Saturday, March 31, 2012

Server side code in-side aspx

I usually use code-behind pages in ASP.Net, but occasionally I have to put my
server code inside an aspx file.
I have a problem finding the correct signature for a button click event.
Private Sub loginbtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles loginbtn.Click
compiles in in code behind, but it doesn't compile inside an aspx file.

How can I write a server event handler and put the code inside an asp file?That is the correct signature. What's the error you get?

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

> I usually use code-behind pages in ASP.Net, but occasionally I have to
> put my
> server code inside an aspx file.
> I have a problem finding the correct signature for a button click
> event.
> Private Sub loginbtn_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles loginbtn.Click
> compiles in in code behind, but it doesn't compile inside an aspx
> file.
> How can I write a server event handler and put the code inside an asp
> file?

Server side code in-side aspx

I usually use code-behind pages in ASP.Net, but occasionally I have to put m
y
server code inside an aspx file.
I have a problem finding the correct signature for a button click event.
Private Sub loginbtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles loginbtn.Click
compiles in in code behind, but it doesn't compile inside an aspx file.
How can I write a server event handler and put the code inside an asp file?That is the correct signature. What's the error you get?
-Brock
DevelopMentor
http://staff.develop.com/ballen

> I usually use code-behind pages in ASP.Net, but occasionally I have to
> put my
> server code inside an aspx file.
> I have a problem finding the correct signature for a button click
> event.
> Private Sub loginbtn_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles loginbtn.Click
> compiles in in code behind, but it doesn't compile inside an aspx
> file.
> How can I write a server event handler and put the code inside an asp
> file?
>

Server Side Controls in ASP.NET

Hi,

I have an aspx page with some server side textboxes.

I have a button onmy page which allows users to add data
to a database.

In my onclick event for my button when I try and get teh
value from the textbox using..

Dim myString as String = textbox1.text

...it is blank.

When I do a..

Dim myString = Request.Form("textbox1")

...I get the value the user enetered.

I have declared my textbox as a control in my codebehind.

And it is an asp.net textbox.

Any ideas why this is?

This is baffling me.

Kerri.Have you added the "runat=server" attribute to the template HTML for the
text box?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Kerri" <anonymous@.discussions.microsoft.com> wrote in message
news:017401c39cc4$12c55070$a501280a@.phx.gbl...
> Hi,
> I have an aspx page with some server side textboxes.
> I have a button onmy page which allows users to add data
> to a database.
> In my onclick event for my button when I try and get teh
> value from the textbox using..
> Dim myString as String = textbox1.text
> ..it is blank.
> When I do a..
> Dim myString = Request.Form("textbox1")
> ..I get the value the user enetered.
> I have declared my textbox as a control in my codebehind.
> And it is an asp.net textbox.
> Any ideas why this is?
> This is baffling me.
> Kerri.

Server side error

Im trying to get my first aspx page working to no avail.
Im using Visual Studio .Net and when you start web services it gives you a short Hello World program to test the server with. When i try to run it all i get is the following error message.

Unable to start debugging on server.
Server side error occured on sending debug HTTP request.

I have tried all the procedures recommended on the Microsoft error page it sends you to with no luck at all.

Anything im missing?

IIS is installed.hello, make sure IIS is on, and ke sure u have give permission to ASPNET account for the folder in which the aspx page is in !!!
Ive set the asp account to administrator access and still the same error.

For some reason unknown to me my system is running fat32. Is this a problem at all?
administrator is something and aspnet account is something else, maybe this system is makingu troubles !!!!

Server side functionality

Hi All,

I have an html button on .aspx page.

<INPUT class="sbttn" id="btnComplete0" onclick="onComplete
()" type="button" value="Mark Completed"
name="btnComplete0"
When the user clicks on the html button the OnComplete
function is called.

<script language="javascript">
function onComplete()
{

// Client side code

// Clicking the server control via code
WorkItemForm.btnComplete.click();

}
</script
I need to perform some server side functinality whenever
user clicks the html button. So I place a hidden server
control (id = btnComplete) on the .aspx page. In the
client side code I automatically click the server control
( WorkItemForm.btnComplete.click();).

On the click event of hidden server control, I write the
server side code in .aspx.cs page.

// Code in .aspx.cs page

private void btnComplete_Click(object sender,
System.EventArgs e)
{
// Calling Server Side Code
}

I am using btnComplete server control as an intermediate
to perform server side functionality.

Problem:

I want to get rid of server control.
Is there a way to perform server side functionality
directly without using server control.

I tried document.FormName.Submit();

This doesn't work. Is there some other way to do so?

Thanks & Regards,
-ReetuHi Reetu,

Here's some VB code that might help you. It uses the submit() method. Not sure
why it didn't work for you.

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Literal1.Text = "<script>function
onCompleted(){alert('action');document.forms[0].submit();}</script>"
If IsPostBack Then
Label2.Text = "I was posted back at: " & Now.TimeOfDay.ToString
End If
End Sub

<form id="Form1" method="post" runat="server">
<p>
<asp:textbox id="TextBox1" runat="server"></asp:textbox></p>
<p>
<asp:label id="Label2" runat="server"></asp:label></p>
<p>
<asp:label id="Label1" runat="server"></asp:label></p>
<p>
<asp:literal id="Literal1" runat="server"></asp:literal></p>
<p> </p>
<p> </p>
<input class="sbttn" id="btnComplete0" onclick="onCompleted()"
type="button" value="Mark Completed"
name="btnComplete0">
</form
"Reetu" <reetu@.ascentn.com> wrote in message
news:06c901c35c60$5aabcc10$a301280a@.phx.gbl...
Hi All,

I have an html button on .aspx page.

<INPUT class="sbttn" id="btnComplete0" onclick="onComplete
()" type="button" value="Mark Completed"
name="btnComplete0"
When the user clicks on the html button the OnComplete
function is called.

<script language="javascript">
function onComplete()
{

// Client side code

// Clicking the server control via code
WorkItemForm.btnComplete.click();

}
</script
I need to perform some server side functinality whenever
user clicks the html button. So I place a hidden server
control (id = btnComplete) on the .aspx page. In the
client side code I automatically click the server control
( WorkItemForm.btnComplete.click();).

On the click event of hidden server control, I write the
server side code in .aspx.cs page.

// Code in .aspx.cs page

private void btnComplete_Click(object sender,
System.EventArgs e)
{
// Calling Server Side Code
}

I am using btnComplete server control as an intermediate
to perform server side functionality.

Problem:

I want to get rid of server control.
Is there a way to perform server side functionality
directly without using server control.

I tried document.FormName.Submit();

This doesn't work. Is there some other way to do so?

Thanks & Regards,
-Reetu

When your page is loaded, checl the HTML source of your page. Your
hidden button will not be rendered at all.

Instead, you can convert your button to a aspx button and add
Javascript event to it from the code behind using

Add this line of code to your page load event.
ButtonName.Attributes.add("onClick","return onComplete()")

Now when you click on your button it will raise the onclick event on
the client side and will call onComplete Javascript function. Inside
the Javascript if you return false, the form will not be submitted and
the server side event of your button will not fire. If you return
true, form will be submitted to the server and your button's onclick
event will be fired on the server.

--
Ram

"Reetu" <reetu@.ascentn.com> wrote in message news:<06c901c35c60$5aabcc10$a301280a@.phx.gbl>...
> Hi All,
> I have an html button on .aspx page.
> <INPUT class="sbttn" id="btnComplete0" onclick="onComplete
> ()" type="button" value="Mark Completed"
> name="btnComplete0">
> When the user clicks on the html button the OnComplete
> function is called.
> <script language="javascript">
> function onComplete()
> {
> // Client side code
> // Clicking the server control via code
> WorkItemForm.btnComplete.click();
> }
> </script>
>
> I need to perform some server side functinality whenever
> user clicks the html button. So I place a hidden server
> control (id = btnComplete) on the .aspx page. In the
> client side code I automatically click the server control
> ( WorkItemForm.btnComplete.click();).
> On the click event of hidden server control, I write the
> server side code in .aspx.cs page.
> // Code in .aspx.cs page
> private void btnComplete_Click(object sender,
> System.EventArgs e)
> {
> // Calling Server Side Code
> }
> I am using btnComplete server control as an intermediate
> to perform server side functionality.
> Problem:
> I want to get rid of server control.
> Is there a way to perform server side functionality
> directly without using server control.
> I tried document.FormName.Submit();
> This doesn't work. Is there some other way to do so?
> Thanks & Regards,
> -Reetu
Thanks a lot, it works.

Regards,
-Reetu

>--Original Message--
>When your page is loaded, checl the HTML source of your
page. Your
>hidden button will not be rendered at all.
>Instead, you can convert your button to a aspx button and
add
>Javascript event to it from the code behind using
>Add this line of code to your page load event.
>ButtonName.Attributes.add("onClick","return onComplete()")
>Now when you click on your button it will raise the
onclick event on
>the client side and will call onComplete Javascript
function. Inside
>the Javascript if you return false, the form will not be
submitted and
>the server side event of your button will not fire. If
you return
>true, form will be submitted to the server and your
button's onclick
>event will be fired on the server.
>--
>Ram
>"Reetu" <reetu@.ascentn.com> wrote in message
news:<06c901c35c60$5aabcc10$a301280a@.phx.gbl>...
>> Hi All,
>>
>> I have an html button on .aspx page.
>>
>> <INPUT class="sbttn" id="btnComplete0"
onclick="onComplete
>> ()" type="button" value="Mark Completed"
>> name="btnComplete0">
>>
>> When the user clicks on the html button the OnComplete
>> function is called.
>>
>> <script language="javascript">
>> function onComplete()
>> {
>>
>> // Client side code
>>
>> // Clicking the server control via code
>> WorkItemForm.btnComplete.click();
>>
>> }
>> </script>
>>
>>
>> I need to perform some server side functinality
whenever
>> user clicks the html button. So I place a hidden server
>> control (id = btnComplete) on the .aspx page. In the
>> client side code I automatically click the server
control
>> ( WorkItemForm.btnComplete.click();).
>>
>> On the click event of hidden server control, I write
the
>> server side code in .aspx.cs page.
>>
>> // Code in .aspx.cs page
>>
>> private void btnComplete_Click(object sender,
>> System.EventArgs e)
>> {
>> // Calling Server Side Code
>> }
>>
>> I am using btnComplete server control as an
intermediate
>> to perform server side functionality.
>>
>> Problem:
>>
>> I want to get rid of server control.
>> Is there a way to perform server side functionality
>> directly without using server control.
>>
>> I tried document.FormName.Submit();
>>
>> This doesn't work. Is there some other way to do so?
>>
>> Thanks & Regards,
>> -Reetu
>.

Server Side Include showing up in Screen Display

I am trying to include a subroutine in my aspx file, but when I do it shows up in the screen output. I have a sub and end sub as the first and last lines in the script, and I put the include statement near the top of the file. (See below)

<%@dotnet.itags.org. Page Language="VBScript" Debug="true" %>
<%@dotnet.itags.org. Import Namespace="System.IO" %>
<%@dotnet.itags.org. Import Namespace="System.Data.OleDb" %>
<!--#include file="Get_Database_value.vbs"-->

<script runat="server">
Sub Page_Load
Response.Write ("Nothing")
End Sub
</script>

If I try to put the include inside the script directives it flags that as an error. I have read how includes could be used for headers and footers, but for that you put the includes inside the <html> </html> tags. I am coming from an asp background where I just included the file with vb code at the top of the asp page and it worked fine. I have read some things about the configuration file and how you can put compiled code in subdirectories, but right now I just want to get it to work.

Thanks for any help

Fred Rodriguez

Hi,

I believe it is not the right way to attached a script file. At ASP.NET you can put all your code/classes under App_Code folder in the root directory of your code. And normally classes in ASP.Net 2.0 uses .vb extension.

I suggest you change your Get_Database_value.vbs into a .net 2.0 format and put it under App_Code. If your using Visual Studio Express it's very easy to add App_Code folder.

Cheers...

Thursday, March 29, 2012

Server side menu problem

Hi,
I have a frameset page that contains two frames:
1. the first frame, an aspx page, contains a menu for navigating in the
website.
2. the second frame contains content, pdf, html or other aspx files
The problem is that the menu activates a server-side methods when the user
clicks on one of the menu items.
However, from the server side I cannot control in which frame the content
will appears, it will always be in the menu frame itself.
So, how can I control from a server side function the frame to display the
content?
Is it even possible?
If not, how to avoid it without using client-based menus?
Thanks, Ohad
Ohad Young
Medical Informatics Research Center
Ben Gurion University
Information System Eng
Office Phone: 972-8-6477160
Cellular Phone: 972-54-518301
E-Mail: ohadyn@dotnet.itags.org.bgumail.bgu.ac.ilOhad,
How does your server-side menu navigate to another page? In other words,
when you click on a menu item, what component originates postback? This
component should have property "target" where you can specify the frame
name.
Eliyahu
"Ohad Young" <ohadyn@.bgumail.bgu.ac.il> wrote in message
news:O4PqPK2XEHA.3044@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I have a frameset page that contains two frames:
> 1. the first frame, an aspx page, contains a menu for navigating in the
> website.
> 2. the second frame contains content, pdf, html or other aspx files
> The problem is that the menu activates a server-side methods when the user
> clicks on one of the menu items.
> However, from the server side I cannot control in which frame the content
> will appears, it will always be in the menu frame itself.
> So, how can I control from a server side function the frame to display the
> content?
> Is it even possible?
> If not, how to avoid it without using client-based menus?
> Thanks, Ohad
> --
> Ohad Young
> Medical Informatics Research Center
> Ben Gurion University
> Information System Eng
> Office Phone: 972-8-6477160
> Cellular Phone: 972-54-518301
> E-Mail: ohadyn@.bgumail.bgu.ac.il
>
Frames, by their nature, are client side objects.
What is your reasoning for wanting navigation to occur on the server? Which
controls are you using in the menu? If I'm following that correctly then
this architecture doesn't make sense to me since navigation itself is also
really a client side operation in that the client requests the page to
navigate to and the server merely provides it back to the client.
If you're doing some type of processing then calling Response.Redirect() or
Server.Transfer(), couldn't you create a redirection page that performs the
appropriate processing then redirects and link to the redirection page? If
you're not doing any processing other than a redirect you should just link
directly to the desired file. In either case, just set the target attribute
to the appropriate frame.
You could probably also get away with setting the target attribute of the
form to the desired frame...
If you're still against using a client based mechanism, then your option
becomes convert the menu to a WebControl and ditch the frames.
Anything you can do to reduce the number of round trips to the server will
improve your application's performance. Doing a postback then
Response.Redirect() results in two round trips. Requesting a redirection
page and calling Response.Redirect results in two round trips. Linking to
the page directly or using Server.Transfer() results in one round trip.
"Ohad Young" <ohadyn@.bgumail.bgu.ac.il> wrote in message
news:O4PqPK2XEHA.3044@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I have a frameset page that contains two frames:
> 1. the first frame, an aspx page, contains a menu for navigating in the
> website.
> 2. the second frame contains content, pdf, html or other aspx files
> The problem is that the menu activates a server-side methods when the user
> clicks on one of the menu items.
> However, from the server side I cannot control in which frame the content
> will appears, it will always be in the menu frame itself.
> So, how can I control from a server side function the frame to display the
> content?
> Is it even possible?
> If not, how to avoid it without using client-based menus?
> Thanks, Ohad
> --
> Ohad Young
> Medical Informatics Research Center
> Ben Gurion University
> Information System Eng
> Office Phone: 972-8-6477160
> Cellular Phone: 972-54-518301
> E-Mail: ohadyn@.bgumail.bgu.ac.il
>
hi ohad, did you find the answer?
i have the same problem as well.
10x, alon.
****************************************
******************************
Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET
resources...

Server side menu problem

Hi,

I have a frameset page that contains two frames:
1. the first frame, an aspx page, contains a menu for navigating in the
website.
2. the second frame contains content, pdf, html or other aspx files
The problem is that the menu activates a server-side methods when the user
clicks on one of the menu items.
However, from the server side I cannot control in which frame the content
will appears, it will always be in the menu frame itself.
So, how can I control from a server side function the frame to display the
content?
Is it even possible?
If not, how to avoid it without using client-based menus?

Thanks, Ohad

--
Ohad Young
Medical Informatics Research Center
Ben Gurion University
Information System Eng
Office Phone: 972-8-6477160
Cellular Phone: 972-54-518301
E-Mail: ohadyn@dotnet.itags.org.bgumail.bgu.ac.ilOhad,

How does your server-side menu navigate to another page? In other words,
when you click on a menu item, what component originates postback? This
component should have property "target" where you can specify the frame
name.

Eliyahu

"Ohad Young" <ohadyn@.bgumail.bgu.ac.il> wrote in message
news:O4PqPK2XEHA.3044@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I have a frameset page that contains two frames:
> 1. the first frame, an aspx page, contains a menu for navigating in the
> website.
> 2. the second frame contains content, pdf, html or other aspx files
> The problem is that the menu activates a server-side methods when the user
> clicks on one of the menu items.
> However, from the server side I cannot control in which frame the content
> will appears, it will always be in the menu frame itself.
> So, how can I control from a server side function the frame to display the
> content?
> Is it even possible?
> If not, how to avoid it without using client-based menus?
> Thanks, Ohad
> --
> Ohad Young
> Medical Informatics Research Center
> Ben Gurion University
> Information System Eng
> Office Phone: 972-8-6477160
> Cellular Phone: 972-54-518301
> E-Mail: ohadyn@.bgumail.bgu.ac.il
Frames, by their nature, are client side objects.

What is your reasoning for wanting navigation to occur on the server? Which
controls are you using in the menu? If I'm following that correctly then
this architecture doesn't make sense to me since navigation itself is also
really a client side operation in that the client requests the page to
navigate to and the server merely provides it back to the client.

If you're doing some type of processing then calling Response.Redirect() or
Server.Transfer(), couldn't you create a redirection page that performs the
appropriate processing then redirects and link to the redirection page? If
you're not doing any processing other than a redirect you should just link
directly to the desired file. In either case, just set the target attribute
to the appropriate frame.

You could probably also get away with setting the target attribute of the
form to the desired frame...

If you're still against using a client based mechanism, then your option
becomes convert the menu to a WebControl and ditch the frames.

Anything you can do to reduce the number of round trips to the server will
improve your application's performance. Doing a postback then
Response.Redirect() results in two round trips. Requesting a redirection
page and calling Response.Redirect results in two round trips. Linking to
the page directly or using Server.Transfer() results in one round trip.

"Ohad Young" <ohadyn@.bgumail.bgu.ac.il> wrote in message
news:O4PqPK2XEHA.3044@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I have a frameset page that contains two frames:
> 1. the first frame, an aspx page, contains a menu for navigating in the
> website.
> 2. the second frame contains content, pdf, html or other aspx files
> The problem is that the menu activates a server-side methods when the user
> clicks on one of the menu items.
> However, from the server side I cannot control in which frame the content
> will appears, it will always be in the menu frame itself.
> So, how can I control from a server side function the frame to display the
> content?
> Is it even possible?
> If not, how to avoid it without using client-based menus?
> Thanks, Ohad
> --
> Ohad Young
> Medical Informatics Research Center
> Ben Gurion University
> Information System Eng
> Office Phone: 972-8-6477160
> Cellular Phone: 972-54-518301
> E-Mail: ohadyn@.bgumail.bgu.ac.il
hi ohad, did you find the answer?
i have the same problem as well.
10x, alon.

************************************************** ********************
Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

Server side script block doesnt run

Hi,
I put...
void Page_PreRender(Object Src, EventArgs E)
{
txtBxPassword.Attributes.Add("onload", "value='password';");
}
in an aspx page and it doesn't appear to do anything. Is there any reason why a code block like this wouldn't run?
Cheers,
WT.
istxtBxPassworda server control ? it might not be an object yet at prerender stage (guessing) and i don't think it would have a value attribute.
If it is a server control - couldn't you just do something like this in Page_Load() -txtBxPassword.text="Password"
HTH

server side replacing window?

Hi, I am wondering if we can program any server side code that will achieve this like "javascript:window.top.location.replace(page.aspx);" ... ??

eg:

void Button1_CLick(object sender, EventArgs e)
{

//replace the window like in javascirpt

}No, not from within the server code. You have to return the javascript and have that do the replace.

Server Side Scripting in ASP.Net

Hello,
I am new to .Net, I want to know how do I code Server Side
Validation scripting in a .aspx page. I am using Visual Studio .Net 2005.
Please Help me.
Thank you> Hello,
> I am new to .Net, I want to know how do I code Server Side
> Validation scripting in a .aspx page. I am using Visual Studio .Net 2005.
> Please Help me.
> Thank you
Drag a CustomValidator onto the page, set properties like ErrorMessage
(it's permitted to leave ControlToValidate blank!). Double click it, to
create a server-side handler.
Add any testing code and set the args.IsValid to true or false,
depending on the result of the test.
Note: when you set the ControlToValidate to some control (textbox), and
the value of that control is empty, the validator (read: your server
side code) is NOT run. If you leave ControlToValidate empty, your code
is always run.
Hans Kesting

Server Side Scripting in ASP.Net

Hello,
I am new to .Net, I want to know how do I code Server Side
Validation scripting in a .aspx page. I am using Visual Studio .Net 2005.
Please Help me.
Thank youHello,

Quote:

Originally Posted by

I am new to .Net, I want to know how do I code Server Side
Validation scripting in a .aspx page. I am using Visual Studio .Net 2005.
Please Help me.
Thank you


Drag a CustomValidator onto the page, set properties like ErrorMessage
(it's permitted to leave ControlToValidate blank!). Double click it, to
create a server-side handler.
Add any testing code and set the args.IsValid to true or false,
depending on the result of the test.

Note: when you set the ControlToValidate to some control (textbox), and
the value of that control is empty, the validator (read: your server
side code) is NOT run. If you leave ControlToValidate empty, your code
is always run.

Hans Kesting

Monday, March 26, 2012

Server tage not well formed

Hello,
Can anyone tell me if this is possible. If yes then can you identify the error in this line. I am writing this line of code in .aspx file in VB.NET v1.1

<asp:Image id="productImage" runat="server" ImageUrl="<%# ConfigurationSettings.AppSettings("virtualdir") & DataBinder.Eval(Container.DataItem,"WebImageName")%>"></asp:Image>

The error says server tag not well formed.

Thanks

I would create a variable (string), to concatenate this:
ConfigurationSettings.AppSettings("virtualdir") & DataBinder.Eval(Container.DataItem,"WebImageName")

Dim sPath as string
sPath=ConfigurationSettings.AppSettings("virtualdir") & WebImageName ' (substitute WebImageName with however you retrieve this-like datareader/dataset...

Then, in your ImageURL:
ImageURL='<%# sPath %>'


Thanks for the help... But how can i write a fuction in the server tag. Do i need to write it seperately and make be call that function, if so can u say how can i do that.

Thanks Again.


It is a better idea if you use a method in the code behind to use the concatenation.

protected string FormatPath(string webImageName)
{
string virtualDirectory = (string) ConfigurationSettings.AppSettings["virtualdir"];
return virtualDirectory + webImageName;
}

Hope this helps!
I forgot you need to add something like this also:

<asp:Image id="productImage" runat="server" ImageUrl='<%# (string) FormatPath(DataBinder.Eval("Container.DataItem","webImageUrl") %>' "></asp:Image

Server Transfer

I want to transfer to a search page from my default page to
SearchResults.aspx and I want to pass a variable named strSearch.
So far I have:
Dim strSearch as string
strSearch = tbSearch.text
Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
It is throwing this error:
Compiler Error Message: BC30648: String constants must end with a
double quote
I do not understand. Help anyone?Here's a nice, simple way to pass values from one page to another:
(VB.NET code)
'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")
Then, in WebForm2.aspx:
'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)
Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/i...te/default.aspx
http://www.aspalliance.com/kenc/passval.aspx
http://www.dotnetbips.com/displayarticle.aspx?id=79
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Sparky Arbuckle" <twa@.secureroot.com> wrote in message
news:1108528696.261435.215090@.f14g2000cwb.googlegroups.com...
>I want to transfer to a search page from my default page to
> SearchResults.aspx and I want to pass a variable named strSearch.
> So far I have:
> Dim strSearch as string
> strSearch = tbSearch.text
> Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
> It is throwing this error:
> Compiler Error Message: BC30648: String constants must end with a
> double quote
> I do not understand. Help anyone?
>
anyone else got any suggestions?
Hi,
Your Server.Transfer line should be: -
Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch)
HTH
regards
Joyjit
"Sparky Arbuckle" <twa@.secureroot.com> wrote in message
news:1108528696.261435.215090@.f14g2000cwb.googlegroups.com...
> I want to transfer to a search page from my default page to
> SearchResults.aspx and I want to pass a variable named strSearch.
> So far I have:
> Dim strSearch as string
> strSearch = tbSearch.text
> Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
> It is throwing this error:
> Compiler Error Message: BC30648: String constants must end with a
> double quote
> I do not understand. Help anyone?
>
On 15 Feb 2005, "Sparky Arbuckle" <twa@.secureroot.com> postulated in
news:1108532798.517363.148550@.c13g2000cwb.googlegroups.com:

> anyone else got any suggestions?
>
Why the extra quote at the end of the line?
-- ip

Server Transfer

I want to transfer to a search page from my default page to
SearchResults.aspx and I want to pass a variable named strSearch.

So far I have:

Dim strSearch as string
strSearch = tbSearch.text
Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")

It is throwing this error:

Compiler Error Message: BC30648: String constants must end with a
double quote

I do not understand. Help anyone?Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/i...te/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetbips.com/displayarticle.aspx?id=79

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

"Sparky Arbuckle" <twa@.secureroot.com> wrote in message
news:1108528696.261435.215090@.f14g2000cwb.googlegr oups.com...
>I want to transfer to a search page from my default page to
> SearchResults.aspx and I want to pass a variable named strSearch.
> So far I have:
> Dim strSearch as string
> strSearch = tbSearch.text
> Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
> It is throwing this error:
> Compiler Error Message: BC30648: String constants must end with a
> double quote
> I do not understand. Help anyone?
anyone else got any suggestions?
Hi,

Your Server.Transfer line should be: -

Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch)

HTH

regards
Joyjit

"Sparky Arbuckle" <twa@.secureroot.com> wrote in message
news:1108528696.261435.215090@.f14g2000cwb.googlegr oups.com...
> I want to transfer to a search page from my default page to
> SearchResults.aspx and I want to pass a variable named strSearch.
> So far I have:
> Dim strSearch as string
> strSearch = tbSearch.text
> Server.Transfer("SearchBrowse.aspx?strSearch=" & strSearch ")
> It is throwing this error:
> Compiler Error Message: BC30648: String constants must end with a
> double quote
> I do not understand. Help anyone?
On 15 Feb 2005, "Sparky Arbuckle" <twa@.secureroot.com> postulated in
news:1108532798.517363.148550@.c13g2000cwb.googlegr oups.com:

> anyone else got any suggestions?

Why the extra quote at the end of the line?

-- ip

server unavailable error message

i get thius error msg when i run my aspx page
Server Application Unavailable
The web application you are attempting to access on this
web server is currently unavailable. Please hit
the "Refresh" button in your web browser to retry your
request.

Administrator Note: An error message detailing the cause
of this specific request failure can be found in the
application event log of the web server. Please review
this log entry to discover what caused this error to
occur.
and when i viwew evernt log
i see the following msg:

Event Type:Error
Event Source:ASP.NET 1.1.4322.0
Event Category:None
Event ID:1084
Date:10/27/2003
Time:9:19:58 AM
User:N/A
Computer:SHAHZADPC
Description:
aspnet_wp.exe could not be started. The error code for the
failure is 80004005. This error can be caused when the
worker process account has insufficient rights to read
the .NET Framework files. Please ensure that the .NET
Framework is correctly installed and that the ACLs on the
installation directory allow access to the configured
account.

wat shud i do
it was woeking well previously,suddenly this error has
started teasing mecheck out this faq
http://www.extremeexperts.com/Net/F...navailable.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"shahzad" <khuwajashahzad@.hotmail.com> wrote in message
news:048701c39c41$c0886f40$a101280a@.phx.gbl...
> i get thius error msg when i run my aspx page
> Server Application Unavailable
> The web application you are attempting to access on this
> web server is currently unavailable. Please hit
> the "Refresh" button in your web browser to retry your
> request.
> Administrator Note: An error message detailing the cause
> of this specific request failure can be found in the
> application event log of the web server. Please review
> this log entry to discover what caused this error to
> occur.
> and when i viwew evernt log
> i see the following msg:
> Event Type: Error
> Event Source: ASP.NET 1.1.4322.0
> Event Category: None
> Event ID: 1084
> Date: 10/27/2003
> Time: 9:19:58 AM
> User: N/A
> Computer: SHAHZADPC
> Description:
> aspnet_wp.exe could not be started. The error code for the
> failure is 80004005. This error can be caused when the
> worker process account has insufficient rights to read
> the .NET Framework files. Please ensure that the .NET
> Framework is correctly installed and that the ACLs on the
> installation directory allow access to the configured
> account.
> wat shud i do
> it was woeking well previously,suddenly this error has
> started teasing me
Did you recently apply an IE security update to XP?

http://www.asp.net/faq/ms03-32-Issue.aspx

"shahzad" <khuwajashahzad@.hotmail.com> wrote in message
news:048701c39c41$c0886f40$a101280a@.phx.gbl...
> i get thius error msg when i run my aspx page
> Server Application Unavailable
> The web application you are attempting to access on this
> web server is currently unavailable. Please hit
> the "Refresh" button in your web browser to retry your
> request.
> Administrator Note: An error message detailing the cause
> of this specific request failure can be found in the
> application event log of the web server. Please review
> this log entry to discover what caused this error to
> occur.
> and when i viwew evernt log
> i see the following msg:
> Event Type: Error
> Event Source: ASP.NET 1.1.4322.0
> Event Category: None
> Event ID: 1084
> Date: 10/27/2003
> Time: 9:19:58 AM
> User: N/A
> Computer: SHAHZADPC
> Description:
> aspnet_wp.exe could not be started. The error code for the
> failure is 80004005. This error can be caused when the
> worker process account has insufficient rights to read
> the .NET Framework files. Please ensure that the .NET
> Framework is correctly installed and that the ACLs on the
> installation directory allow access to the configured
> account.
> wat shud i do
> it was woeking well previously,suddenly this error has
> started teasing me
i have made the changes but im still geting the smae msg
i have win2K profesional wid VS.net 2003
plz temme how can i remove asp.net
i want to reinstall it
i have reinstalled the vs.net
but there is nothing different
i have tried ur articles as well

>--Original Message--
>Did you recently apply an IE security update to XP?
>http://www.asp.net/faq/ms03-32-Issue.aspx
>
>"shahzad" <khuwajashahzad@.hotmail.com> wrote in message
>news:048701c39c41$c0886f40$a101280a@.phx.gbl...
>> i get thius error msg when i run my aspx page
>> Server Application Unavailable
>> The web application you are attempting to access on this
>> web server is currently unavailable. Please hit
>> the "Refresh" button in your web browser to retry your
>> request.
>>
>> Administrator Note: An error message detailing the cause
>> of this specific request failure can be found in the
>> application event log of the web server. Please review
>> this log entry to discover what caused this error to
>> occur.
>> and when i viwew evernt log
>> i see the following msg:
>>
>> Event Type: Error
>> Event Source: ASP.NET 1.1.4322.0
>> Event Category: None
>> Event ID: 1084
>> Date: 10/27/2003
>> Time: 9:19:58 AM
>> User: N/A
>> Computer: SHAHZADPC
>> Description:
>> aspnet_wp.exe could not be started. The error code for
the
>> failure is 80004005. This error can be caused when the
>> worker process account has insufficient rights to read
>> the .NET Framework files. Please ensure that the .NET
>> Framework is correctly installed and that the ACLs on
the
>> installation directory allow access to the configured
>> account.
>>
>> wat shud i do
>> it was woeking well previously,suddenly this error has
>> started teasing me
>>
>>
>>
>
>.
i have fixed it by garace of ALLAH
ihave done the following steps
1)create accnt named aspdemo
2)added this users group
3)gave it "log on as batch job" right
4)add this accnt and passowrd in processmodel section of
machine.config file
5)restarted the PC
u always restart ur machine ater making changes in
machine.config in order for these changes to be efective

>--Original Message--
>i get thius error msg when i run my aspx page
>Server Application Unavailable
>The web application you are attempting to access on this
>web server is currently unavailable. Please hit
>the "Refresh" button in your web browser to retry your
>request.
>Administrator Note: An error message detailing the cause
>of this specific request failure can be found in the
>application event log of the web server. Please review
>this log entry to discover what caused this error to
>occur.
> and when i viwew evernt log
>i see the following msg:
>Event Type:Error
>Event Source:ASP.NET 1.1.4322.0
>Event Category:None
>Event ID:1084
>Date:10/27/2003
>Time:9:19:58 AM
>User:N/A
>Computer:SHAHZADPC
>Description:
>aspnet_wp.exe could not be started. The error code for
the
>failure is 80004005. This error can be caused when the
>worker process account has insufficient rights to read
>the .NET Framework files. Please ensure that the .NET
>Framework is correctly installed and that the ACLs on the
>installation directory allow access to the configured
>account.
>wat shud i do
>it was woeking well previously,suddenly this error has
>started teasing me
>
>.

Saturday, March 24, 2012

Server Unavailable Error Message.

When I run my .aspx page I get a server inavailabel error.
It appears to be some kind of odbc error.. Here are the details:
In the event log it says:
1. aspnet_wp.exe (PID: 7012) stopped unexpectedly.
2. The system has called a custom component and that component has failed and generated an exception. This indicates a problem with the custom component. Notify the developer of this component that a failure has occurred and provide them with the information below.
Component Prog ID: 0[ODBC][Env 164f14e8]
Method Name: IDispenserDriver::CreateResource
Process Name: aspnet_wp.exe
The serious nature of this error has caused the process to terminate.
Exception: C0000005
Address: 0x1F7D5694
Call Stack:
odbc32!CloseODBCPerfData + 0x32E

Does anyone know how I might try to correct this.
ThanksCould you post some code to give us a better idea of what you are doing.

Thanks
Greg
Greg,
I am connection to db2 an filling retrieveing some data.
Here is my code.

Try

Dim str_Db2ConnString As String = "dsn=dev04;UID=ddb2btch;PWD=Db2$btch#02;"
Dim connDb2 As New Odbc.OdbcConnection(str_Db2ConnString)

Dim str_sql As String = "SELECT b.cust_num, b.credit_line_num, a.cust_short_name, b.usd_util_amt, b.activation_date FROM db2ib.ibtcust a, db2ib.ibtcred b where a.cust_num = b.cust_num order by a.cust_short_name"

' OdbcDataAdapter Represents a set of data commands and a database connection that are used to fill the DataSet and update the data source.
Dim myDA As System.Data.Odbc.OdbcDataAdapter = New System.Data.Odbc.OdbcDataAdapter(str_sql, connDb2)

' the datset is what holds the results from the database.
Dim myDS As DataSet = New DataSet
myDA.Fill(myDS, "Custs")
Dim objTable As DataTable
Dim objRows(), objRow As DataRow
objTable = myDS.Tables("Custs")
'objRows = objTable.Select("cust_num = '254038'")
objRows = objTable.Select()
Dim iSub3 As Integer

Response.Write("Data from Db2" & "<br>")
For Each objRow In objRows
Response.Write(iSub3 & " & Cust_Num = " & objRow.Item(0) & "<br>")
iSub3 = iSub3 + 1
Next

' Try to load a second sql resultset into the dataset.
str_sql = "SELECT ibs_branch, short_name from db2ib.ibtbrch order by ibs_branch"

' OdbcDataAdapter Represents a set of data commands and a database connection that are used to fill the DataSet and update the data source.
Dim myDA2 As System.Data.Odbc.OdbcDataAdapter = New System.Data.Odbc.OdbcDataAdapter(str_sql, connDb2)

' the datset is what holds the results from the database.
'Dim myDS2 As DataSet = New DataSet
myDA2.Fill(myDS, "Branches")
'Dim objTable As DataTable
'Dim objRows(), objRow As DataRow
objTable = myDS.Tables("Branches")
objRows = objTable.Select()
'Response.Write("myDs.Tables.Count = " & myDS.Tables(0).TableName & "<br>")
iSub3 = 1
For Each objRow In objRows
Response.Write(iSub3 & " " & objRow.Item(0) & "<br>")
iSub3 = iSub3 + 1
Next

myDS.Dispose()
myDA.Dispose()
myDA2.Dispose()

connDb2.Close()
connDb2 = Nothing

Catch MyOdbcException As OdbcException
Dim i As Integer
Response.Write(MyOdbcException.ToString)
Catch MyException As Exception
Response.Write(MyException.ToString)
Catch SysException As NullReferenceException
Response.Write(SysException.ToString)

End Try


Thanks,
Brian

server updateing data already on the client

Hi

I would like that when data is updated in a database on
the sever taht all instance of that data already being
viewed on aspx pages by clients be updated. Is this
acheiveble with an activeX control on the page that
listens for information from the server? I dont want to
have to use page refreshes firing in a loop.

Thanks in advance

JakeYou can write a Windows Form application and host it in a browser, just like
ActiveX. You'll need to use remoting for that though.
The catch is that every user must have IE and .NET framework installed.
Other browsers don't support .NET "applets"

"Jake" <anonymous@.discussions.microsoft.com> wrote in message
news:2418501c45f00$7f8a8640$a501280a@.phx.gbl...
> Hi
> I would like that when data is updated in a database on
> the sever taht all instance of that data already being
> viewed on aspx pages by clients be updated. Is this
> acheiveble with an activeX control on the page that
> listens for information from the server? I dont want to
> have to use page refreshes firing in a loop.
> Thanks in advance
> Jake
Thanks that sounds exactly like what I am after.

Would you know of where I can find information about
imbeding/running windows application in a web page/
browser and remoting?

Thanks again

Jake

>--Original Message--
>You can write a Windows Form application and host it in
a browser, just like
>ActiveX. You'll need to use remoting for that though.
>The catch is that every user must have IE and .NET
framework installed.
>Other browsers don't support .NET "applets"
>"Jake" <anonymous@.discussions.microsoft.com> wrote in
message
>news:2418501c45f00$7f8a8640$a501280a@.phx.gbl...
>> Hi
>>
>> I would like that when data is updated in a database on
>> the sever taht all instance of that data already being
>> viewed on aspx pages by clients be updated. Is this
>> acheiveble with an activeX control on the page that
>> listens for information from the server? I dont want
to
>> have to use page refreshes firing in a loop.
>>
>> Thanks in advance
>>
>> Jake
>
>.

server updateing data already on the client

Hi
I would like that when data is updated in a database on
the sever taht all instance of that data already being
viewed on aspx pages by clients be updated. Is this
acheiveble with an activeX control on the page that
listens for information from the server? I dont want to
have to use page refreshes firing in a loop.
Thanks in advance
JakeYou can write a Windows Form application and host it in a browser, just like
ActiveX. You'll need to use remoting for that though.
The catch is that every user must have IE and .NET framework installed.
Other browsers don't support .NET "applets"
"Jake" <anonymous@.discussions.microsoft.com> wrote in message
news:2418501c45f00$7f8a8640$a501280a@.phx
.gbl...
> Hi
> I would like that when data is updated in a database on
> the sever taht all instance of that data already being
> viewed on aspx pages by clients be updated. Is this
> acheiveble with an activeX control on the page that
> listens for information from the server? I dont want to
> have to use page refreshes firing in a loop.
> Thanks in advance
> Jake
Thanks that sounds exactly like what I am after.
Would you know of where I can find information about
imbeding/running windows application in a web page/
browser and remoting?
Thanks again
Jake

>--Original Message--
>You can write a Windows Form application and host it in
a browser, just like
>ActiveX. You'll need to use remoting for that though.
>The catch is that every user must have IE and .NET
framework installed.
>Other browsers don't support .NET "applets"
>"Jake" <anonymous@.discussions.microsoft.com> wrote in
message
> news:2418501c45f00$7f8a8640$a501280a@.phx
.gbl...
to
>
>.
>

Server Unavaillable

Hi, when i typehttp://localhost/helloWorld.aspx. . I get this error.
____________________________________________________________________________________________________

Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note:An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur
-----------------------------------
It is not only this asp.net page but all my previous web applications also give the same error.
Another thing , When i try to create asp.net application, i get this error.
--------------------------
The Web server reported the following error when attempting to create or open the Web project located at the followingURL:'http://localhost/WebApplication1.' 'HTTP/1.1 500 Internal Server Error'.
-----------------------------------
A point to note was that I was formerly able to run these applications when I was at home and now I have shifted to a hostel which is on campus network.Wonder if the problem is due to this??
Need help ... Thanks in advance.

Well...did you look at the Application Log of the Event Viewer, like the instructions tell you? See where it says "Administrator Note".
What did the Log say?

Are you hosting this application on your local PC or Hostel PC.
Also since you are connected from your hostel It can be that some sort of firewall is blocking you.
Disconnect from the Hostel Network and try to view the pages.

Yah , man it is my PC..
Anyway, I did check my Event Viewer.And found there were 2 errors.
This was the first
Event Type: Error
Event Source: ASP.NET 1.1.4322.0
Event Category: None
Event ID: 1007
Date: 9/7/2005
Time: 12:28:22 PM
User: N/A
Computer: ENDOFDAYS
Description:
aspnet_wp.exe could not be launched because the username and/or password supplied in the processModel section of the config file are invalid.

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

And this the second.

Event Type: Error
Event Source: ASP.NET 1.1.4322.0
Event Category: None
Event ID: 1084
Date: 9/7/2005
Time: 12:28:23 PM
User: N/A
Computer: ENDOFDAYS
Description:
aspnet_wp.exe could not be started. The error code for the failure is 80004005. This error can be caused when the worker process account has insufficient rights to read the .NET Framework files. Please ensure that the .NET Framework is correctly installed and that the ACLs on the installation directory allow access to the configured account.

For more information, see Help and Support Center athttp://go.microsoft.com/fwlink/events.asp.
Anyone knoes wat is causing this errors.
Thanks for all helps..


That would explain your errors for sure.
I haven't seen these messages before, but it sure looks like something is messed up with your permissions and/or .NET install. Did you install IIS after .NET maybe? I wonder if this is a job foraspnet_regiis.exe -i ?
If this were me, I'd consider just re-installing the .NET framework and ensure I was logged in with Adminstrator rights when I did so.
Hope that helps.