|
hi,i'm using this code in my submit button :
if(CheckBox1.Checked)
{
HttpCookie cook=new HttpCookie("user",TextBox1.Text);
Response.Cookies.Add(cook);
}
but when i check my cookies folder i found nothing,can anyone help me on this,thanx
|
|
|
|
|
|
I have opened a Popup window with this code:
Dim sScript As String
sScript &= ""
sScript &= "window.open('" & sUrl & "',''," & sFeatures & ");"
sScript &= ""
Response.Write(sScript)
In the Popup.aspx page I have three places to input information and I store each piece recorded in the session variable with this code:
Dim strExpectations As String = ddlExpectations.SelectedItem.Value
Dim strMarks As String = txtMarks.Text
Dim strNotes As String = txtNotes.text
Session.Add("Expectations", strExpectations)
Session.Add("Marks", strMarks)
Session.Add("Notes", strNotes)
I want to now close this popup and then retrieve the info at the window I used to open the popup in the beginning. the original window consists of a dynamically created table and when they make their selections I want to use that info to change the cell background and place soem text in the cell. After this is done the session will be cleared and the info sent through to the database.
I cannot get the Popup.aspx window to close - is there a simple way to place something like Me.Close()***this does not work, under the session stuff on the submit button???
Thx, Tammy
|
|
|
|
|
|
Hi I added a checkbox control in a datalist. I need to check the count of checkbox that user selects.each row has one checkbox. i need to count the number of checkbox before user can submit. only if the number of checkbox is 5 (not more not less) user can submit the form otherwise display error message. I manage to put a label control with in a datalist where by i can get the relevant id associated with that checkbox but couldnt figure out how can i actually submit the form only if its 5. checkbox is hardcoded and not coming from database.the row looks like this
checkbox productname productdesc
now if the user checks the checkbox i need to get a productname of the relevant row and if its five i need to submit those 5 product unless not.
please help how to acheive this. a code example will be great.
|
|
|
|
|
Hi there,
You can check out this site[^] for the sample script to get reference to the checkboxes (though it's using datagrid). You then use a custom validator to simply check the number of the selected checkboxes.
|
|
|
|
|
i have acheived this one but now it has to be more advanced.
how do i put checkbox list inside the nested repeater. the values of the listitem of checkboxlist should be coming form database. and also i need to make sure that user only checks only one checkbox item from checkboxlist. is there any quick tips for acheiving this. i know how to display information in nested datagrid such as.
Parent
child
child
child
but this time child should be actually a dynamic checkboxlist and based on which checkboxitem user select i need to get both parent id and child ID.
i am just looking for code hint to follow up.
any reference will be great at the moment. or a quick code hint.
thanks in forward.
|
|
|
|
|
If you only allow the use to select one item, you may use the RadioButtonList control instead. You can use a datasource control to feed to the RadioButtonList, or programmatically bind data to the control using the DataSource property and DataBind method. You can read more about how to use this control in MSDN.
|
|
|
|
|
Hi My aspx looks something like below,
-----------------------------------
<asp:repeater id="dlTrainingCourse" runat="server" OnItemDataBound="dlTrainingCourse_ItemDataBound">
<ItemTemplate>
<TABLE style="BORDER-RIGHT: #e0e0e0 1px solid; BORDER-TOP: #e0e0e0 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #e0e0e0 1px solid; FONT-FAMILY: verdana"
cellSpacing="0" cellPadding="4" width="100%">
<TR>
<TD>
<asp:Label id=lblCourseId Text='<%# DataBinder.Eval(Container.DataItem, "tcId") %>' Runat="server" Visible="False">
</asp:Label>
<asp:Label id=lblCoursename Font-Bold="True" Text='<%# DataBinder.Eval(Container.DataItem, "tcName") %>' Runat="server">
</asp:Label></TD>
</TR>
<TR>
<TD><%# DataBinder.Eval(Container.DataItem, "tcDesc") %></TD>
</TR>
<TR>
<TD>Venue: <%# DataBinder.Eval(Container.DataItem, "tcVenue") %></TD>
</TR>
<TR>
<TD>Contact: <%# DataBinder.Eval(Container.DataItem, "tcContact") %></TD>
</TR>
</TABLE>
<asp:repeater id="dlTrainingCourseDate" runat="server">
<ItemTemplate>
<Table>
<tr>
<td style="font:8pt arial">
<%# DataBinder.Eval(Container.DataItem, "tcDateDesc") %>
</td>
</tr>
</Table>
</ItemTemplate>
</asp:repeater>
<hr size="1">
</ItemTemplate>
</asp:repeater>
--------------------------------------
and the output looks something like,
----------------------
event text
event desc
Venue info
Contact
25th October 2006 (pivot)
23rd May 2007
30th May 2007
27th June 2007
---------------------
the last four date info should actually be populated from checkboxlist or radiobuttonlist. user should only be able to select only one date and not more than 5 events. i need to capture event name and their preferred date.
i am at lost when binding the data to checkboxlist
please help.
|
|
|
|
|
Hi!
I actually managed to get displaying the checkboxlist working but having trouble getting the value of eventText and value of selected checkbox of each event.
my aspx looks something like,
===============================
<asp:repeater id="dlTrainingCourse" runat="server" OnItemDataBound="dlTrainingCourse_ItemDataBound">
<ItemTemplate>
<TABLE style="BORDER-RIGHT: #e0e0e0 1px solid; BORDER-TOP: #e0e0e0 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #e0e0e0 1px solid; FONT-FAMILY: verdana"
cellSpacing="0" cellPadding="4" width="100%">
<TR>
<TD>
<asp:Label id=lblCourseId Text='<%# DataBinder.Eval(Container.DataItem, "tcId") %>' Runat="server" Visible="False">
</asp:Label>
<asp:Label id=lblCoursename Font-Bold="True" Text='<%# DataBinder.Eval(Container.DataItem, "tcName") %>' Runat="server">
</asp:Label></TD>
</TR>
<TR>
<TD><%# DataBinder.Eval(Container.DataItem, "tcDesc") %></TD>
</TR>
<TR>
<TD>Venue: <%# DataBinder.Eval(Container.DataItem, "tcVenue") %></TD>
</TR>
<TR>
<TD>Contact: <%# DataBinder.Eval(Container.DataItem, "tcContact") %></TD>
</TR>
<tr>
<td>
<asp:CheckBoxList id="chkDates" Font-Name="Verdana" Font-Size="8pt" DataTextField="tcDateDesc" DataValueField="tcDateDesc" runat="server"></asp:CheckBoxList>
</td>
</tr>
</TABLE>
<hr size="1">
</ItemTemplate>
</asp:repeater>
please help.
thanks
|
|
|
|
|
Hi!
In my button click event i actualy want to get what list item has been selected from checkboxitem but i get invalid cast exception
below are my button click event vb codes.
i get exception in 2nd line of below code
-------------------
Dim item As DataListItem
For Each item In dlTrainingCourse.Items
Dim chk As CheckBoxList = item.FindControl("chkDates")
For Each li As ListItem In chk.Items
If li.Selected Then
Response.Write(li.Value)
End If
Next
Next
------------
please help. much appreciation in forward.
|
|
|
|
|
uglyeyes wrote: Dim item As DataListItem
You may want to declare this object as RepeaterItem instead of the DataListItem.
|
|
|
|
|
Hi Its working fine.
but how will i let user only select one checkboxItem within checkboxlist within a repeater.
I know radiobuttonlist will be a good option but again. once the user selects a radiobuttonitem within a repeater they cant actually uncheck it.
please help.
|
|
|
|
|
You'll have many ways to check if the user select one or more items:
+ Use the server side code to count the number of the selected checkboxes in the Items collection.
+ Use javascript to validate if the user chooses more than 2 items, you can use a custom validator in this case.
+ Simply persist the current number of the selected checkboxes in a hidden textbox using javascript, and use the CompareValidator to validate the textbox.
+ Keep using the radiobuttonlist, but may consider adding another checkbox and place it right at the beggining of the category name to give the user an option to not choose any item.
It's weird when getting voted down with all 1s
|
|
|
|
|
Hi all
Can any one send me the example for Threading. Because i need to use threading concept in my app. Thanks in advance
Thanks and Regards
Venkat
|
|
|
|
|
Try doing a search on this site or elsewhere. Threading is a common knowledge area, you should find plenty of examples. Be warned though, you may actually have to do some reserch, thinking and work on your own.
|
|
|
|
|
Hi
In asp.net 1.1 datagrid, i have one template column in that i have link. for that link i am passing command arguments like this
CommandArgument='<%# DataBinder.Eval(Container.DataItem, "id1")%>'
I want to pass multiple values(id1, id2) through command argument. how to pass.
can anyone tell syntax for this
awaiting for reply
regards
GV Ramana
|
|
|
|
|
I think you have to do a delimited string and parse it out in the event handler. IE:
<br />
CommandArgument='<%# DataBinder.Eval(Container.DataItem, "id1") + "|" + DataBinder.Eval(Container.DataItem, "id2")%>'<br />
Dirk Watkins
|
|
|
|
|
Hi Developers
I have performed two way sorting on Datagrid and its working very smoothly(When we first click on header of any column, grid wil b sorted in Acsending Order and when we clcik second time on column header, grid will be sorted in descending order).
Now what I need is that there should be two Arrows Up/Down with each header of Datagrid, Now if we click on Down Arrow the Grid should be sort in Descending Order and When we click on Up Arrow datagrid should be sorted in Ascending Order.
Thanks in advance
Lets work it Out.........!
-- modified at 7:36 Tuesday 11th July, 2006
|
|
|
|
|
Hi you can use Headertemplate to add ImageButton with default ImageUrl=Uparrow.
then on Item command you do sorting functon also add the Current- sort critria in viewstate
Then OnItemDataBound event find sorting ImageButton in ListItemType.Header and bases on the Current- sort critria in viewstate change the imageUrl property of ImageButton
Nobody is perfect i'm Nobody
|
|
|
|
|
Thanks for your reply BUT this all I have done, I need to have two Arrow Buttons with each Column Header and when user click on Up Arrow grid should be sorted in Ascending order and vice versa. I hope its clear now...
Lets work it Out.........!
|
|
|
|
|
Hi friends,
I am told to convert all the response which is coming from server which is in aspx format to html format and then display. the purpose of doing like this is to increase the browsing speed. All the link in the web page is linked to their respective .html files. Can anyone tell me how to do this.
Thanks in advance
Vipin
|
|
|
|
|
??
When you run as aspx page, what it returns to the browser is just html (as it has to be). The only thing that you would really be changing would be the page extension...
Why?
|
|
|
|
|
If you want to speed up the site there are other steps you can take. Try reading "Speed Up Your Site" by these guys: http://www.websiteoptimization.com/speed/. This book is really good even though it is a couple years old. It's worth the read.
In .net you can disable viewstates if your are not using them and try to keep your control IDs shorter. The less characters that are sent to the client the faster the site will be.
Although, if your .aspx pages are NOT "doing" anything then static HTML pages would be faster as it won't have to process any code server side.
Dirk Watkins
|
|
|
|
|
Hi,
I know its possible to provide security for ASP.NET webservice through Security settings provided by IIS. But I would like to know how to secure each individual [WebMethods] methods requset that arrive from disparate client.
Mohan P
|
|
|
|