Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts

Monday, March 26, 2012

This is for the nth time I am posting. Is there no one to help!

I have a datalist control in my aspx page(this is
paginated and everytime submits to itself). I am calling a
function within my datalist that returns a html control
(radio button ) in the form of the string. I also have asp
server controls(labels) in the datalist. When the form is
processed, I am retrieving the values of the radio buttons
through Request.form. To retrieve the values of the asp
server controls , I am using FindControl method. But this
is written in the Page_Load method, so it returns the
values of the current page before the page gets submitted.
I want the values after the page gets submitted. How do I
retrieve them.
If I use onserverclick on my button (which is a html
control with rollover capability <a href>) , the onclick
doesn't work fine for validating the html controls. I
don't have runat=server on my form tag when I have onclick
attribute on the button. I am new to asp.net. I am not
able to use both onclick and onserverclick at the same
time. Why is it so..

Please help!!Maybe you could post some code. Its hard to tell what your problem is from
you message which you have posted several times.

"ani" <anonymous@.discussions.microsoft.com> wrote in message
news:01b601c3a3ce$cbdc78c0$a401280a@.phx.gbl...
> I have a datalist control in my aspx page(this is
> paginated and everytime submits to itself). I am calling a
> function within my datalist that returns a html control
> (radio button ) in the form of the string. I also have asp
> server controls(labels) in the datalist. When the form is
> processed, I am retrieving the values of the radio buttons
> through Request.form. To retrieve the values of the asp
> server controls , I am using FindControl method. But this
> is written in the Page_Load method, so it returns the
> values of the current page before the page gets submitted.
> I want the values after the page gets submitted. How do I
> retrieve them.
> If I use onserverclick on my button (which is a html
> control with rollover capability <a href>) , the onclick
> doesn't work fine for validating the html controls. I
> don't have runat=server on my form tag when I have onclick
> attribute on the button. I am new to asp.net. I am not
> able to use both onclick and onserverclick at the same
> time. Why is it so..
> Please help!!
sounds like you are not leveraging the page.postback property. page_load
gets called every time the page loads whether it is post back or not. the
onserverclicks will get loaded after page_load. sounds like you are loading
the datalist twice before doing a request.form on the data. you should only
build the datalist once. it will be in the viewstate on the postback, so no
need to reload it.

function page_load()
if page.ispostback then
'get checkbox values and labels or do nothing and rely on the
OnServerClick event
else
'load datalist
end if
end function

also if you want to use javascript onclick and asp.net's onserverclick do
this...
<input type="submit" id="btn" value="go" runat="server" onclick="return
validate();"
if you use <asp:button...>, the onclick event is looking for a public
function in the codebehind which default to private... not sure, but I have
to change that to public everytime.

again, without code samples, it is tough. I hope I helped a little bit.
~psb

"ani" <anonymous@.discussions.microsoft.com> wrote in message
news:01b601c3a3ce$cbdc78c0$a401280a@.phx.gbl...
> I have a datalist control in my aspx page(this is
> paginated and everytime submits to itself). I am calling a
> function within my datalist that returns a html control
> (radio button ) in the form of the string. I also have asp
> server controls(labels) in the datalist. When the form is
> processed, I am retrieving the values of the radio buttons
> through Request.form. To retrieve the values of the asp
> server controls , I am using FindControl method. But this
> is written in the Page_Load method, so it returns the
> values of the current page before the page gets submitted.
> I want the values after the page gets submitted. How do I
> retrieve them.
> If I use onserverclick on my button (which is a html
> control with rollover capability <a href>) , the onclick
> doesn't work fine for validating the html controls. I
> don't have runat=server on my form tag when I have onclick
> attribute on the button. I am new to asp.net. I am not
> able to use both onclick and onserverclick at the same
> time. Why is it so..
> Please help!!
This is how the presentation code look like. If I use
runat = server, ie; when I try to use onserverclick on the
button the javascript doesn't work . The displayanswers
method in the form returns a string of html text,basically
a table with radiobuttons or checkboxes aligned in it.

<form id="frmQuestion" method="post"
<ASP:DataList id="Questions" ShowHeader="false"
ShowFooter="false" runat="server" >
<ItemTemplate>
<TABLE ALIGN="left" >
<td
<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_ID")%> '
ID="QuestionID" NAME="QuestionID">
</asp:Label
</td
<td
<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_Txt")%>'
ID="QuestionTxt" NAME="QuestionTxt">
</asp:Label
</td
<td
<%# DisplayAnswers(DataBinder.Eval
(Container.DataItem, "MainQuestion_ID"),DataBinder.Eval
(Container.DataItem, "QuestionTypeID")) %
</td>
</tr></TABLE>
</ItemTemplate>
</ASP:DataList
<table align=right >
<tr><td
<a id=btnForward href="http://links.10026.com/?link=#"
onMouseOut="bforward.src='images/bforward.gif';"
onMouseOver="bforward.src='images/bforward_f2.gif';"
runat=server onclick="return validate();"><IMG
SRC="images/bforward.gif" ALT="" NAME="bforward"
ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A
</td></tr></table
I would like to retrieve the question id and the answer
(user-input) at the same time on click of the button. The
questionaire is paginated and this is the only form i am
using.

The code behind looks somewhat this way:

Sub Page_Load(ByVal Sender As Object, ByVal E As
EventArgs)

Dim oDt As DataTable
Dim oQuestion As Question ('This is the class
in my business layer)
oQuestion = New Question

Questions.DataSource = New DataView(oDt)
Questions.DataBind()

End Sub

What is the best way to handle Questionaire(online test)
projects . Can I display questions and answers at the same
time and how do I get questionid's and user-input to
insert into the database. There can be subquestions
This is how the presentation code look like. If I use
runat = server, ie; when I try to use onserverclick on the
button the javascript doesn't work . The displayanswers
method in the form returns a string of html text,basically
a table with radiobuttons or checkboxes aligned in it.

<form id="frmQuestion" method="post"
<ASP:DataList id="Questions" ShowHeader="false"
ShowFooter="false" runat="server" >
<ItemTemplate>
<TABLE ALIGN="left" >
<td
<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_ID")%> '
ID="QuestionID" NAME="QuestionID">
</asp:Label
</td
<td
<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_Txt")%>'
ID="QuestionTxt" NAME="QuestionTxt">
</asp:Label
</td
<td
<%# DisplayAnswers(DataBinder.Eval
(Container.DataItem, "MainQuestion_ID"),DataBinder.Eval
(Container.DataItem, "QuestionTypeID")) %
</td>
</tr></TABLE>
</ItemTemplate>
</ASP:DataList
<table align=right >
<tr><td
<a id=btnForward href="http://links.10026.com/?link=#"
onMouseOut="bforward.src='images/bforward.gif';"
onMouseOver="bforward.src='images/bforward_f2.gif';"
runat=server onclick="return validate();"><IMG
SRC="images/bforward.gif" ALT="" NAME="bforward"
ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A
</td></tr></table
I would like to retrieve the question id and the answer
(user-input) at the same time on click of the button. The
questionaire is paginated and this is the only form i am
using.

The code behind looks somewhat this way:

Sub Page_Load(ByVal Sender As Object, ByVal E As
EventArgs)

Dim oDt As DataTable
Dim oQuestion As Question ('This is the class
in my business layer)
oQuestion = New Question

Questions.DataSource = New DataView(oDt)
Questions.DataBind()

End Sub

What is the best way to handle Questionaire(online test)
projects . Can I display questions and answers at the same
time and how do I get questionid's and user-input to
insert into the database. There can be subquestions

This is really weird...

I've got a search on my site that runs off index server.. it works well enough but has something very strange going on - it only returns results for certain searches if the seach words are in uppercase..

Now - rather than try to figure out what was going on, I just converted the search terms to upper case in my asp.net script.. it still didn't work.

Next option - transform all text in the search box to uppercase using css..

still doesn't work?

It's really odd - I've got a text box that can only display uppercase letters yet the search returns different results if I have caps lock on or off. And, as I say, I'm also converting the text to uppercase before I chuck it into my sql..

It's almost as if there's another bit of info being sent - namely that I have caps lock on??

Am I missing something completely obvious here?

Any ideas?

Thanks.The index search should be case insensitive, so I am doubtful that has anything to do with it.

Can you provide the pertinent code surround the actual query execution?

Terri

Saturday, March 24, 2012

This page can not be saved

Hi,

There are web sites that it is not possible to save the site locally.
(File-> Save As... returns error)
How can i do that with my own pages.

Thanks,
AliHi Ali,

Thanks for posting in the community! My name is Steven, and I'll be
assisting you on this issue.
From your description, you found that sometimes when you use the IE's
File->Save As menu item to save a certain web
site's page to local disk, you encountered some errors which prevent you
from finishing such operation.
Also, you'd like to implement the same effect for your own site or pages,
yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my understanding, here is my suggestions:
1. Generally, when we view a web page in the Browser(such as IE or Mozilla
or..), the page's html source has been already downloaded to the local disk
on the client machine. It is in the internet tempory folder. So as for the
situation you mentioned, I think the error is likely to be caused two
things:
1) The page may have related or linked any other resources which prevent
you from downloading it so that it cause the error. If so, you may try use
the "View Source" menu of the browser and try viewing the page's html
source. If ok, you can still by copy the source and save it as a html file
manually, we still can download it :).
2) There does occurs some third party techniques on how to encrypt the web
page's html source from being cracked or protect some certain web resources
from being download. Such function is implemented by doing some certain
modification on the page's source code.

2. Here is some third party components which provide some similiar
funcitons on protecting page source or web resources. You may have a view
on them:
#Html Protector --protect your page's html source
http://www.minihttpserver.net/htmlg/index.php

#Web document download protection tool
http://ebizwhiz-publishing.com/ebookprotect.htm

#How to prevent theft of your source code
http://www.vortex-webdesign.com/help/hidesource.htm

Please check out the preceding suggestions. If you have any questions,
please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Hi Ali,

Have you had a chance to check out my suggestions or have you got any ideas
on this issue? If you need any further help, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Yes I did. Now I underestand that for protect page scripts we need to use
3rd party products.
Thanks for help.
Ali

"Steven Cheng[MSFT]" <v-schang@.online.microsoft.com> wrote in message
news:zoeKSV$5DHA.1988@.cpmsftngxa07.phx.gbl...
> Hi Ali,
>
> Have you had a chance to check out my suggestions or have you got any
ideas
> on this issue? If you need any further help, please feel free to post
here.
>
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)