Showing posts with label contain. Show all posts
Showing posts with label contain. Show all posts

Thursday, March 29, 2012

server side or client side page?

a page that contain a validation control and starting a storeProcedures when the user click on a button --is considered as a client side page or as a server side page?
it seems to me that in asp.net everthing is server side, where are the client side pages?
thanks

The sp is server side, but the validation can be on or the other, depending on how it's coded.
ASP.Net has it's validations, so it's server side when using them.
But you can also make validations via JavaScript, so that would be client side.
Zath


but the validation controls (like RequiredFiledValidator) is a client side validation...,isnt that right?

because i know that if any of the validators are found to be on error the submission of the form to the server is cancelled...
so is there something that is done on the client side in asp.net?
thanks for the help


ppl1 wrote:

but the validation controls (like RequiredFiledValidator) is a client side validation...,isnt that right?

because i know that if any of the validators are found to be on error the submission of the form to the server is cancelled...


Yes the RequiredFieldValidator does the client side validation

ppl1 wrote:


so is there something that is done on the client side in asp.net?
thanks for the help


You can do so many things on client side and you should do so many things on client side to minimize postbacks if possible. So what exactly is that you are asking. Usually you use javascript to do client side stuff..


ok...so lets go back to my first question-> a page that contain a validation control and starting a storeProcedures when the user click on a button --is considered as a client side page or as a server side page?

ppl1 wrote:

ok...so lets go back to my first question-> a page that contain a validation control and starting a storeProcedures when the user click on a button --is considered as a client side page or as a server side page?


A webpage physically is considered a client side output for the asp.net server side processing. Asp.net uses browser to show its output to the user in the form of a web page. So, a webpage is a client side entity. Server wouldnt know anything about it after it outputs the html into the browser. Now, when the user clicks on the button, the page gets postback to the server. In here there are several things that goes on. The event of user clicking the button will be a client side event, and the page postbacks and server does some processing in response to the user action, which is button click event.

ok thanks for the help
Hi ,
Answering your question, calling a Stored Procedure is a Server Side call.
A page can contain server as well as client side technologies.
Hope it helps
Shahram

Monday, March 26, 2012

Server tags cannot contain <% ... %> constructs

<cc:SourceWindow id="SourceWindow1"
FileName="<%=Request.ServerVariables["PATH_INFO"]%>" RunAt="server" >
The above produces the following error:
Server tags cannot contain <% ... %> constructs.
Any idea, what to do here? I am an old ASP programmer.
Thanks for help !
LMJin your code for loading the page use :
SourceWindow1.FileName = [whatever]
"lm Jr" <lmJR@.aspdotnet.learner> wrote in message news:O%235EWkrjHHA.3264@.TK2MSFTNGP04.phx.
gbl...
> <cc:SourceWindow id="SourceWindow1" FileName="<%=Request.ServerVariables["
PATH_INFO"]%>" RunAt="server" >
> The above produces the following error:
> Server tags cannot contain <% ... %> constructs.
> Any idea, what to do here? I am an old ASP programmer.
> Thanks for help !
> LMJ
>
"lm Jr" <lmJR@.aspdotnet.learner> wrote in message
news:O%235EWkrjHHA.3264@.TK2MSFTNGP04.phx.gbl...
> <cc:SourceWindow id="SourceWindow1"
> FileName="<%=Request.ServerVariables["PATH_INFO"]%>" RunAt="server" >
> The above produces the following error:
> Server tags cannot contain <% ... %> constructs.
> Any idea, what to do here? I am an old ASP programmer.
In your Page_Load method, do this:
SourceWindow1.FileName = Request.ServerVariables["PATH_INFO"]
I strongly suggest you never use the technique you tried above. Substituting
directly into the rendered HTML can cause problems. For example, I've been
fighting today with user controls that do things like this:
<script language="javascript">
function Something()
{
var control = document.getElementById("<%= _someControl.ClientID %>");
}
</script>
This innocent piece of script causes one copy of itself to be created for
each instance on a page of the control containing it. Not a problem if the
script is small and there are few instances, but on one of our pages, each
script block is about 750 lines long, and there are over 10 instances of the
control on the same page. It adds up.
Good luck with ASP.NET. Please feel free to ask for help on these
newsgroups, and please try to learn the .NET way of doing things - there's a
reason why ASP.NET was invented, and that reason is ASP!
--
John Saunders [MVP]
Thanks for your suggestions. That was really helpful !!
LM J

Server tags cannot contain <% ... %> constructs

Hi,

I've put a appSetting tag into my web.config, but when I try to catch its
value to my Image WebControl occurs the follow error: "Server tags cannot
contain <% ... %> constructs."

on myPage.aspx (Notice the ImageUrl tag):
<asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
stema"]%> /
So, What's wrong with my ImageUrl attribution?
Is there any way to do that?

thanks a lot
Marcosyou can set this property programmatically within a server script block:
Image1.ImageUrl =
System.Configuration.ConfigurationSettings.AppSett ings....
you cannot use <%%> inside a web control as web controls already run at the
server.
sharon.

"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've put a appSetting tag into my web.config, but when I try to catch its
> value to my Image WebControl occurs the follow error: "Server tags cannot
> contain <% ... %> constructs."
> on myPage.aspx (Notice the ImageUrl tag):
> <asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> stema"]%> />
> So, What's wrong with my ImageUrl attribution?
> Is there any way to do that?
> thanks a lot
> Marcos
Thanks... but, I'd like to do it inside my .aspx file...

Isn't it possible?

tanks
Marcos

"Sharon" <talsharon@.hotmail.com> escreveu na mensagem
news:OvBFDJmIEHA.3128@.TK2MSFTNGP10.phx.gbl...
> you can set this property programmatically within a server script block:
> Image1.ImageUrl =
> System.Configuration.ConfigurationSettings.AppSett ings....
> you cannot use <%%> inside a web control as web controls already run at
the
> server.
> sharon.
> "Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
> news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> > Hi,
> > I've put a appSetting tag into my web.config, but when I try to catch
its
> > value to my Image WebControl occurs the follow error: "Server tags
cannot
> > contain <% ... %> constructs."
> > on myPage.aspx (Notice the ImageUrl tag):
> > <asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> > stema"]%> />
> > So, What's wrong with my ImageUrl attribution?
> > Is there any way to do that?
> > thanks a lot
> > Marcos
i don't know of any way, and there is no reason to do it inside the html
section.
one of the ideas behind web controls design, is the separation of code from
html.

"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:e0ARXWmIEHA.364@.TK2MSFTNGP11.phx.gbl...
> Thanks... but, I'd like to do it inside my .aspx file...
> Isn't it possible?
> tanks
> Marcos
> "Sharon" <talsharon@.hotmail.com> escreveu na mensagem
> news:OvBFDJmIEHA.3128@.TK2MSFTNGP10.phx.gbl...
> > you can set this property programmatically within a server script block:
> > Image1.ImageUrl =
> > System.Configuration.ConfigurationSettings.AppSett ings....
> > you cannot use <%%> inside a web control as web controls already run at
> the
> > server.
> > sharon.
> > "Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
> > news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> > > Hi,
> > > > I've put a appSetting tag into my web.config, but when I try to catch
> its
> > > value to my Image WebControl occurs the follow error: "Server tags
> cannot
> > > contain <% ... %> constructs."
> > > > on myPage.aspx (Notice the ImageUrl tag):
> > > <asp:Image id="Image1" runat="server"
> ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> > > stema"]%> />
> > > > So, What's wrong with my ImageUrl attribution?
> > > Is there any way to do that?
> > > > thanks a lot
> > > Marcos
> >
use the binding syntax <%# bindingexpression %
-- bruce (sqlwork.com)

"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've put a appSetting tag into my web.config, but when I try to catch its
> value to my Image WebControl occurs the follow error: "Server tags cannot
> contain <% ... %> constructs."
> on myPage.aspx (Notice the ImageUrl tag):
> <asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> stema"]%> />
> So, What's wrong with my ImageUrl attribution?
> Is there any way to do that?
> thanks a lot
> Marcos
In your code there are some errors :

The <%= construct can only be used in client script for write some value
from server (like old ASP).
your Image is server side not in client side!!!!

You can use the <%# construct. This is for binding value!
<asp:Image id="Image1" runat="server"
ImageUrl='<%#System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgS
istema"]%>' /
this code require a DataBind() method call!!!

Brun

"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've put a appSetting tag into my web.config, but when I try to catch its
> value to my Image WebControl occurs the follow error: "Server tags cannot
> contain <% ... %> constructs."
> on myPage.aspx (Notice the ImageUrl tag):
> <asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> stema"]%> />
> So, What's wrong with my ImageUrl attribution?
> Is there any way to do that?
> thanks a lot
> Marcos

Server tags cannot contain <% ... %> constructs

Hi,

I've put a appSetting tag into my web.config, but when I try to catch its
value to my Image WebControl occurs the follow error: "Server tags cannot
contain <% ... %> constructs."

on myPage.aspx (Notice the ImageUrl tag):
<asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
stema"]%> /
So, What's wrong with my ImageUrl attribution?
Is there any way to do that?

thanks a lot
Marcosyou can set this property programmatically within a server script block:
Image1.ImageUrl =
System.Configuration.ConfigurationSettings.AppSett ings....
you cannot use <%%> inside a web control as web controls already run at the
server.
sharon.

"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've put a appSetting tag into my web.config, but when I try to catch its
> value to my Image WebControl occurs the follow error: "Server tags cannot
> contain <% ... %> constructs."
> on myPage.aspx (Notice the ImageUrl tag):
> <asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> stema"]%> />
> So, What's wrong with my ImageUrl attribution?
> Is there any way to do that?
> thanks a lot
> Marcos
Thanks... but, I'd like to do it inside my .aspx file...

Isn't it possible?

tanks
Marcos

"Sharon" <talsharon@.hotmail.com> escreveu na mensagem
news:OvBFDJmIEHA.3128@.TK2MSFTNGP10.phx.gbl...
> you can set this property programmatically within a server script block:
> Image1.ImageUrl =
> System.Configuration.ConfigurationSettings.AppSett ings....
> you cannot use <%%> inside a web control as web controls already run at
the
> server.
> sharon.
> "Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
> news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> > Hi,
> > I've put a appSetting tag into my web.config, but when I try to catch
its
> > value to my Image WebControl occurs the follow error: "Server tags
cannot
> > contain <% ... %> constructs."
> > on myPage.aspx (Notice the ImageUrl tag):
> > <asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> > stema"]%> />
> > So, What's wrong with my ImageUrl attribution?
> > Is there any way to do that?
> > thanks a lot
> > Marcos
i don't know of any way, and there is no reason to do it inside the html
section.
one of the ideas behind web controls design, is the separation of code from
html.

"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:e0ARXWmIEHA.364@.TK2MSFTNGP11.phx.gbl...
> Thanks... but, I'd like to do it inside my .aspx file...
> Isn't it possible?
> tanks
> Marcos
> "Sharon" <talsharon@.hotmail.com> escreveu na mensagem
> news:OvBFDJmIEHA.3128@.TK2MSFTNGP10.phx.gbl...
> > you can set this property programmatically within a server script block:
> > Image1.ImageUrl =
> > System.Configuration.ConfigurationSettings.AppSett ings....
> > you cannot use <%%> inside a web control as web controls already run at
> the
> > server.
> > sharon.
> > "Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
> > news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> > > Hi,
> > > > I've put a appSetting tag into my web.config, but when I try to catch
> its
> > > value to my Image WebControl occurs the follow error: "Server tags
> cannot
> > > contain <% ... %> constructs."
> > > > on myPage.aspx (Notice the ImageUrl tag):
> > > <asp:Image id="Image1" runat="server"
> ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> > > stema"]%> />
> > > > So, What's wrong with my ImageUrl attribution?
> > > Is there any way to do that?
> > > > thanks a lot
> > > Marcos
> >
use the binding syntax <%# bindingexpression %
-- bruce (sqlwork.com)

"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've put a appSetting tag into my web.config, but when I try to catch its
> value to my Image WebControl occurs the follow error: "Server tags cannot
> contain <% ... %> constructs."
> on myPage.aspx (Notice the ImageUrl tag):
> <asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> stema"]%> />
> So, What's wrong with my ImageUrl attribution?
> Is there any way to do that?
> thanks a lot
> Marcos
In your code there are some errors :

The <%= construct can only be used in client script for write some value
from server (like old ASP).
your Image is server side not in client side!!!!

You can use the <%# construct. This is for binding value!
<asp:Image id="Image1" runat="server"
ImageUrl='<%#System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgS
istema"]%>' /
this code require a DataBind() method call!!!

Brun

"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've put a appSetting tag into my web.config, but when I try to catch its
> value to my Image WebControl occurs the follow error: "Server tags cannot
> contain <% ... %> constructs."
> on myPage.aspx (Notice the ImageUrl tag):
> <asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> stema"]%> />
> So, What's wrong with my ImageUrl attribution?
> Is there any way to do that?
> thanks a lot
> Marcos

Quote:

Originally Posted by Bruno Sirianni

In your code there are some errors :

The <%= construct can only be used in client script for write some value
from server (like old ASP).
your Image is server side not in client side!!!!

You can use the <%# construct. This is for binding value!
<asp:Image id="Image1" runat="server"
ImageUrl='<%#System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgS
istema"]%>' /
this code require a DataBind() method call!!!

Brun

"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've put a appSetting tag into my web.config, but when I try to catch its
> value to my Image WebControl occurs the follow error: "Server tags cannot
> contain <% ... %> constructs."
> on myPage.aspx (Notice the ImageUrl tag):
> <asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSe ttings["SrcImgSi
> stema"]%> />
> So, What's wrong with my ImageUrl attribution?
> Is there any way to do that?
> thanks a lot
> Marcos
>

In ASP.NET 2.0 not only can you refer to appSettings declaratively (without using the DataBinding syntax), which is precisely what you are trying to do here, but you can create an ExpressionBuilder that lets you run arbitrary code declaratively, which is precisely what you tried to do. Check it out here: http://infinitiesloop.blogspot.com/

Server tags cannot contain <% ... %> constructs

Hi,
I've put a appSetting tag into my web.config, but when I try to catch its
value to my Image WebControl occurs the follow error: "Server tags cannot
contain <% ... %> constructs."
on myPage.aspx (Notice the ImageUrl tag):
<asp:Image id="Image1" runat="server"
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSettings["SrcI
mgSi
stema"]%> />
So, What's wrong with my ImageUrl attribution?
Is there any way to do that?
thanks a lot
Marcosyou can set this property programmatically within a server script block:
Image1.ImageUrl =
System.Configuration.ConfigurationSettings.AppSettings....
you cannot use <%%> inside a web control as web controls already run at the
server.
sharon.
"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've put a appSetting tag into my web.config, but when I try to catch its
> value to my Image WebControl occurs the follow error: "Server tags cannot
> contain <% ... %> constructs."
> on myPage.aspx (Notice the ImageUrl tag):
> <asp:Image id="Image1" runat="server"
>
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSettings["SrcImgSired">
> stema"]%> />
> So, What's wrong with my ImageUrl attribution?
> Is there any way to do that?
> thanks a lot
> Marcos
>
Thanks... but, I'd like to do it inside my .aspx file...
Isn't it possible?
tanks
Marcos
"Sharon" <talsharon@.hotmail.com> escreveu na mensagem
news:OvBFDJmIEHA.3128@.TK2MSFTNGP10.phx.gbl...
> you can set this property programmatically within a server script block:
> Image1.ImageUrl =
> System.Configuration.ConfigurationSettings.AppSettings....
> you cannot use <%%> inside a web control as web controls already run at
the
> server.
> sharon.
> "Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
> news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
its
cannot
>
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSettings["SrcImgSired">
>
i don't know of any way, and there is no reason to do it inside the html
section.
one of the ideas behind web controls design, is the separation of code from
html.
"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:e0ARXWmIEHA.364@.TK2MSFTNGP11.phx.gbl...
> Thanks... but, I'd like to do it inside my .aspx file...
> Isn't it possible?
> tanks
> Marcos
> "Sharon" <talsharon@.hotmail.com> escreveu na mensagem
> news:OvBFDJmIEHA.3128@.TK2MSFTNGP10.phx.gbl...
> the
> its
> cannot
>
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSettings["SrcImgSired">
>
use the binding syntax <%# bindingexpression %>
-- bruce (sqlwork.com)
"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've put a appSetting tag into my web.config, but when I try to catch its
> value to my Image WebControl occurs the follow error: "Server tags cannot
> contain <% ... %> constructs."
> on myPage.aspx (Notice the ImageUrl tag):
> <asp:Image id="Image1" runat="server"
>
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSettings["SrcImgSired">
> stema"]%> />
> So, What's wrong with my ImageUrl attribution?
> Is there any way to do that?
> thanks a lot
> Marcos
>
In your code there are some errors :
The <%= construct can only be used in client script for write some value
from server (like old ASP).
your Image is server side not in client side!!!!
You can use the <%# construct. This is for binding value!
<asp:Image id="Image1" runat="server"
ImageUrl='<%#System.Configuration.ConfigurationSettings.AppSettings["Src
ImgS
istema"]%>' />
this code require a DataBind() method call!!!
Brun
"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:ulbiAAmIEHA.3240@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've put a appSetting tag into my web.config, but when I try to catch its
> value to my Image WebControl occurs the follow error: "Server tags cannot
> contain <% ... %> constructs."
> on myPage.aspx (Notice the ImageUrl tag):
> <asp:Image id="Image1" runat="server"
>
ImageUrl=<%=System.Configuration.ConfigurationSettings.AppSettings["SrcImgSired">
> stema"]%> />
> So, What's wrong with my ImageUrl attribution?
> Is there any way to do that?
> thanks a lot
> Marcos
>