|
Well, first you need to define what is your sorting criteria. I'm not sure what your sorting criteria is from your post. Once you have that sorted out, the rest is easy. See Here[^] for some examples
|
|
|
|
|
If I understand you correctly, you want to be able to order the items in a list box manually, to arrange the route order. Strictly the list box isn't sorted, but ordered. I assume you want this done without postback until finished, AFAIK (but I could be wrong) there are no out-the-box .net controls to do this, I found this, hopefully it will be helpful:
http://www.velocityreviews.com/forums/t76756-set-display-order-of-listbox-control.html[^]
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
I don't think the listbox will maintain the rearranged order if you do it with javascript on the client side. What kind of database fields do you have behind it? Is there a column to hold the sort order?
You could figure out how may items you are dealing with and dynamically add hidden fields with numbers in their name MyHidden0, MyHidden1 and so on. Then with javascript in the onclientclick of your save button have a function that loops through the options in the listbox and assigns the values to the hidden field. Then you know that the item in MyHidden0 should have sort order 0 and MyHidden1 has a sort order of 1.
|
|
|
|
|
the first thanks for your ideas, even I am thinking about it because I don't know like up or down items of my listbox with 2 button (up, down) and that user see it.
The idea is can put order in listbox for later print a sheet of route for trucks, the first item will be the first customer for distribute and last item will be the last customer for distribute but doesn't exist a rule to order like asc or desc etc, it must be done by user like he wants.
the idea after listbox is ordered is save this information to table for later print.
Well, at the moment I will be happy to know like can up or down items of listbox with two buttons, later know like save it in array.
I imagine that for sample if the item 7 of my listbox I push 3 times my button of "up" it will be my future item 4 but the problem is that my old item 4 now will be item 5 and my old item 6 will be item 7, haha I am losing myself
Thanks for your ideas
|
|
|
|
|
I found the solve very easy
You only call to this sub from button up
Regards
Sub MoveSelectedItemUp(ByVal Box As ListBox)
Dim Index As Integer = Box.SelectedIndex 'Index of selected item
Dim Swap As Object = Box.SelectedItem 'Selected Item
If Not (Swap Is Nothing) Then 'If something is selected...
Box.Items.RemoveAt(Index) 'Remove it
Box.Items.Insert(Index - 1, Swap) 'Add it back in one spot up
'Box.SelectedItem = Swap 'Keep this item selected
End If
End Sub
|
|
|
|
|
Hi Everybody!
I've recently started using ASP.NET in my web development jobs and am now stuck on a security issue.
I have account information stored in little files on my web server, each with the extension ".siteuser". If I type the URL of the file into the address bar, the file is downloaded and everything including contact details and phone numbers are right there in the file.
My question is, how can I configure my server (ASP.NET 3.5) to allow access to these files server-side and forbid clients from downloading them right to their computers?
Thanks!
MrWolfy
|
|
|
|
|
Put the folder where .siteuser files are located in App_Data folder. No file in App_Data can be browsed directly.
|
|
|
|
|
A very poor answer. That is not want App_Data is for and there are better methods to accomplish what the OP needs
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
MrWolfy wrote: how can I configure my server (ASP.NET 3.5) to allow access to these files server-side and forbid clients from downloading them right to their computers?
ASP.Net web.config
MrWolfy wrote: I have account information stored in little files on my web server
Not a good thing, you should use a secure database.
|
|
|
|
|
MrWolfy wrote: I have account information stored in little files on my web server
As davey suggested, keep sensitive information in database.
MrWolfy wrote: how can I configure my server (ASP.NET 3.5) to allow access to these files server-side and forbid clients from downloading them right to their computers?
Here is the solution,
http://forums.asp.net/p/1474362/3423008.aspx[^]
|
|
|
|
|
Wow!
Thanks to everybody who answered! You were quick to reply and completely solved my problem!
Thanks Again!
MrWolfy
|
|
|
|
|
Hi,
I have two calendar extendars and two textboxes for fromDate and toDate in my project.When project runs,current date will be shown as default in two textboxes.What will i do for this?
|
|
|
|
|
Thanusree Duth wrote: When project runs,current date will be shown as default in two textboxes
What do you actually want? Change the default values as per your requirement.
|
|
|
|
|
you can set value in text while page load itselt
|
|
|
|
|
Thanusree Duth wrote: urrent date will be shown as default in two textboxes
Setting Current Date in two TextBox
protected void Page_Load(object sender, EventArgs e)
{
string currentDate= DateTime.Now.ToShortDateString();
fromDate.Text = currentDate;
toDate.Text = currentDate;
}
|
|
|
|
|
|
i am working on excel application in which i need to download the data from excel.
while opening excel through application it always popup message as "Connecting to the server for information"
i want to disabled that meassage.
what i need to do..
i tried .DisplayAlerts = false; But its not working
|
|
|
|
|
Your information is not proper. How you are accessing your excel? Are you using any third party Dlls? Have you debugged to see if there is any popup invoked?
Mugdha_Aditya wrote: i tried .DisplayAlerts = false; But its not working
Which object is having this property?
|
|
|
|
|
no i am not using any third party dll
m opening my excel like this
ApplicationClass xlApp = new ApplicationClass();
//xlApp.ShowStartupDialog = false;
//xlApp.DisplayAlerts = false;
Workbook xlWBook = xlApp.Workbooks.Open(sFileName, 0, false, 5, "", "", false,
Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);
every thing working correctly but when i debug my code... n start downloading the data it gives popup as conneting to server to get informtaion...
popup goes automatically..
but i want to hide tht
|
|
|
|
|
I have two calendar extenders.FromDate and ToDate.I have to validate it by using javasript.FromDate wont become greter than ToDate.when fromdate entered is greater than todate,a messagebox will appear..Pls help me
|
|
|
|
|
1. Get values from textboxes using document.getElementById("yourtextboxid1") and document.getElementById("yourtextboxid2")
2. Compare those values and display proper message
|
|
|
|
|
hey... you can use validation control rather than javascript
<asp:Label ID="lblFromDate" runat="server" CssClass="Label-Normal" Text="From Date :"></asp:Label>
<asp:TextBox ID="txtFromDate" runat="server" ReadOnly="true" Width="70px"> </asp:TextBox>
<asp:ImageButton ID="imgFromDt" runat="server" AlternateText="SelectDate" Height="21px"
ImageUrl="~/images/calender.jpg" OnClientClick="return false;" TabIndex="9" />
<asp:Label ID="lblToDate" runat="server" CssClass="Label-Normal" Text="To Date :"></asp:Label>
<asp:TextBox ID="txtToDate" runat="server" ReadOnly="true" Width="70px"> </asp:TextBox>
<asp:ImageButton ID="imgToDt" runat="server" AlternateText="SelectDate" Height="21px"
ImageUrl="~/images/calender.jpg" OnClientClick="return false;" TabIndex="9" />
<asp:CompareValidator ID="valCompEndDate" runat="server" ControlToCompare="txtFromDate"
ControlToValidate="txtToDate" Display="Dynamic" ErrorMessage="From date should not be greater than to date."
Operator="GreaterThanEqual" Type="Date" Style="width: 40%; font-family: Arial;
font-size: 12px;" ValidationGroup="valGrpExpFile"></asp:CompareValidator>
|
|
|
|
|
Its difficult to read your code, format it.
|
|
|
|
|
if (sender._selectedDate > new Date()) {
alert("Please select any day before Today.");
sender._selectedDate = new Date();
sender._textbox.set_Value(sender._selectedDate.format(sender._format));
}
u can use this script and can modify according to ur need.
regards,
amit
|
|
|
|
|
I have a ajax tool calendarExtendarFromDate,imgFromDate,textBoxFromDate,calendarExtendarToDate,imgToDate and textBoxToDate,When a date is selected from calendarExtendarFromDate,that date is displayed in textBoxFromDate.Likewise in the case of calendarExtendarToDate.Here is the source code:
--------------------------------------------------------------
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="selectDate" runat="server" Text="Select Date:">
</asp:Label>
<asp:TextBox ID="txtFromDate" runat="server" ReadOnly="True"></asp:TextBox>
<img id="imgFromDate" runat="server" src="~/images/calendar.png" alt="~/images/calendar.png"/>
<cc1:CalendarExtender ID="CalendarExtenderFromDate" runat="server" CssClass="cal"
TargetControlID="txtFromDate" PopupButtonID="imgFromDate">
</cc1:CalendarExtender>
<asp:TextBox ID="txtToDate" runat="server" ReadOnly="True" Enabled="False"></asp:TextBox>
<img id="imgToDate" runat="server" src="~/images/calendar.png" alt="~/images/calendar.png" />
<cc1:CalendarExtender ID="CalendarExtenderToDate" runat="server" OnClientDateSelectionChanged="CheckForFutureDate" CssClass="cal" TargetControlID="txtToDate"
PopupButtonID="imgToDate">
</cc1:CalendarExtender>
</ContentTemplate>
</asp:UpdatePanel>
-------------------------------------------------------------
I have radiobuttons..When the radiobutton between is clicked,then only calendarExtendarToDate is enabled.otherwise it becomes in disabled state..I wrote code in jscript as below:
function validate()
{
document.getElementById("imgToDate").disabled=false;
document.getElementById("txtToDate").disabled=false;
}
//call this function in .aspx.cs as below:
rbBetween.Attributes.Add("onClick", "return validate()");
textbox is disabled.When between radio is clicked,then only enabled.But calendarextendar disabled didnt work.Pls help me...
|
|
|
|