|
Yes. I tried now by using Server.MapPath(). But still same problem loosing sessions and static variables becoming null. G. Satish
|
|
|
|
|
Dear Experts
I have gridview with bound with objectDatasource. I want to order by all the results with date. I can not see the property of objectdatasource that can order the result by date. I am waiting for your help please
My code is give as
<asp:ObjectDataSource id="odsCaseMovement" runat="server" OldValuesParameterFormatString="original_{0}"
TypeName="Atlas.Core.ObjectDataSource.odsV_CaseEnquiry" SelectMethod="odsLoadCaseByBarCode" OnSelected="odsCaseMovement_Selected">
<SelectParameters>
<asp:ControlParameter ControlID="txtCaseBarcode" Name="par_caseBarcode" PropertyName="Text"
Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
The gridview is
<acc:AtlasGrid id="grvCaseMovement" runat="server" Width="98%" CssClass="GridTable" DataSourceID="odsCaseMovement" PageSize="20"
AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False" OnRowDataBound="grvCaseMovement_RowDataBound">
<RowStyle CssClass="list_row" />
<PagerTemplate>
<div style="width: 100%; text-align: center;">
<asp:LinkButton CommandName="Page" CommandArgument="First" ID="LinkButton1" runat="server"
Style="color: black"><< First</asp:LinkButton>
<asp:LinkButton CommandName="Page" CommandArgument="Prev" ID="LinkButton2" runat="server"
Style="color: black">< Prev</asp:LinkButton>
[Records
<%= grvCaseMovement.PageIndex * grvCaseMovement.PageSize + 1%>
-
<%= grvCaseMovement.PageIndex * grvCaseMovement.PageSize + grvCaseMovement.Rows.Count%>
Of
<%= Atlas.Core.ObjectDataSource.odsV_CaseEnquiry.rowCount%>
]
<asp:LinkButton CommandName="Page" CommandArgument="Next" ID="LinkButton3" runat="server"
Style="color: black">Next ></asp:LinkButton>
<asp:LinkButton CommandName="Page" CommandArgument="Last" ID="LinkButton4" runat="server"
Style="color: black">Last >></asp:LinkButton>
</div>
</PagerTemplate>
<Columns>
<asp:BoundField DataField="ID" HeaderText="Case ID" Visible="False" />
<asp:BoundField DataField="Barcode" HeaderText="Case Barcode" SortExpression="Barcode" />
<asp:BoundField DataField="OriginalDate" HeaderText="Date Generated" SortExpression="OriginalDate" DataFormatString="{0:dd/MM/yyyy}" />
<asp:BoundField DataField="Date" HeaderText="Delivery Date" DataFormatString="{0:dd/MM/yyyy}" />
<asp:BoundField DataField="AccountName" HeaderText="Account Name" />
<asp:BoundField DataField="AccountNumber" HeaderText="Account Number" />
<asp:BoundField DataField="Loaded" HeaderText="Date & Time Loaded" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}" />
<asp:BoundField DataField="POD" HeaderText="Date & Time Delivered" SortExpression="POD" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}" />
<asp:BoundField DataField="State" HeaderText="Status" SortExpression="State" />
<asp:BoundField DataField="Name" HeaderText="Drop Point" SortExpression="Name" />
<asp:BoundField DataField="RouteNumber" HeaderText="Route Number" SortExpression="RouteNumber" />
<%--<asp:BoundField DataField="Returning" HeaderText="Job Type" SortExpression="Returning" /> --%>
<asp:TemplateField HeaderText="Job Type">
<ItemTemplate>
<asp:Label ID="lblJobType" runat="server" Text='<%# Eval("Returning")%>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Asset">
<ItemTemplate>
<asp:Label id="LabAsset" runat="server" Text='<%# Eval("AssetID") %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="AssetType">
<ItemTemplate>
<asp:Label id="LabAssetType" runat="server" Text='<%# Eval("AssetTypeID") %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Warehouse Poistion" ItemStyle-Wrap="false" SortExpression="WarehousePosID">
<ItemTemplate>
<asp:Label ID="lblWarePos" runat="server" Text ='<%# Eval("WarehousePosID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle CssClass="GridTablePagging" />
<HeaderStyle CssClass="GridTableHeader" />
</acc:AtlasGrid>
|
|
|
|
|
|
It is most like the code you refer.
But in my case sorting is working fine, As you have already noticed I am using AtlasGrid.
I want to load data sorted by DeliveryDate on PageLoad.
Thanks for you intrest in my problem
|
|
|
|
|
So why not just sort as: select [Column1], [Column2],... from [Table} order by [Column] in the underlying sql?Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
Actually I am using EasyObject and I do not have access to EasyObject Code and Database server. I have to order it by date in HTML code or code behind
|
|
|
|
|
<script language="javascript" type="text/javascript">
var dtCh = "/";
var minYear = 1900;
var maxYear = 2100;
function daysInFebruary(year) {
// February has 29 days in any year evenly divisible by four,
// EXCEPT for centurial years which are not also divisible by 400.
return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
for (var i = 1; i <= n; i++) {
this[i] = 31
if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
if (i==2) {this[i] = 29}
}
return this
}
function stripCharsInBag(s, bag) {
var i;
var returnString = "";
// Search through string's characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length; i++) {
var c = s.charAt(i);
if (bag.indexOf(c) == -1)
returnString += c;
}
return returnString;
}
function isInteger(s) {
var i;
for (i = 0; i < s.length; i++) {
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function isDate(dtStr) {
var daysInMonth = DaysArray(12)
var pos1 = dtStr.indexOf(dtCh)
var pos2 = dtStr.indexOf(dtCh, pos1+1)
var strMonth = dtStr.substring(0, pos1)
var strDay = dtStr.substring(pos1+1, pos2)
var strYear = dtStr.substring(pos2+1)
strYr = strYear
if (strDay.charAt(0) == "0" && strDay.length > 1) strDay = strDay.substring(1)
if (strMonth.charAt(0) == "0" && strMonth.length > 1) strMonth = strMonth.substring(1)
for (var i = 1; i <= 3; i++) {
if (strYr.charAt(0) == "0" && strYr.length > 1) strYr = strYr.substring(1)
}
month = parseInt(strMonth)
day = parseInt(strDay)
year = parseInt(strYr)
if (pos1 == -1 || pos2 == -1){
//alert("The date format should be : mm/dd/yyyy")
return false
}
if (strMonth.length < 1 || month < 1 || month > 12){
//alert("Please enter a valid month")
return false
}
if (strDay.length < 1 || day < 1 || day > 31 || (month == 2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
//alert("Please enter a valid day")
return false
}
if (strYear.length != 4 || year == 0 || year < minYear || year > maxYear){
//alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
return false
}
if (dtStr.indexOf(dtCh,pos2+1)!= -1 || isInteger(stripCharsInBag(dtStr, dtCh)) == false){
//alert("Please enter a valid date")
return false
}
return true
}
function CheckDate(oSrc,args){
var fromDate = document.getElementById('TextBox1').value;
var toDate = document.getElementById('TextBox2').value;
if (isDate(fromDate) == true && isDate(toDate) == true){
var isvalid = 1;
var d1;
var d2;
d1 = fromDate;
d2 = toDate;
//Total time for one day
var one_day = 1000*60*60*24;
//Here we need to split the inputed dates to convert them into standard format
//for furter execution
var x = d1.split("/");
var y = d2.split("/");
//date format(Fullyear,month,date)
// var date1 = new Date(x[2], (x[0]-1), x[1]);
// var date2 = new Date(y[2], (y[0]-1), y[1]);
// var month1 = x[0]-1;
// var month2 = y[0]-1;
var date1 = new Date(x[2], (x[1]-1), x[0]);
var date2 = new Date(y[2], (y[1]-1), y[0]);
var month1 = x[1]-1;
var month2 = y[1]-1;
//Calculate difference between the two dates, and convert to days
diff = Math.ceil((date2.getTime()-date1.getTime())/(one_day));
if(diff < 0) {
isvalid = 0;
}
if(eval(isvalid) == 0) {
args.IsValid = false;
return;
}
else {
args.IsValid = true;
}
}
else {
args.IsValid = true;
}
}
</script>dhdh
|
|
|
|
|
So what's your question?Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
I am running .net 3.5 sp1
Where do I get the appropriate aspnet_regsql.exe please?
I ran the one in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 but it says it is not compatible.
This file does not exist in C:\WINDOWS\Microsoft.NET\Framework\v3.5
Any thoughts please?
|
|
|
|
|
arkiboys wrote: says it is not compatible.
What says it is not compatible? It doesn't matter what framework you are using aspnet_regsql.exe only creates the database for asp.net forms auth. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
It gives that error When I try to login to the site.
Thanks
|
|
|
|
|
Then it isn't with the aspnet_regsql. Check your connection string. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi
I am using a multiline textbox in asp.net.
I want if a url is entered in textbox then it should be clickable.
I have goggled but found no answer.
Please help me.
Thanks in advance
|
|
|
|
|
Off the top of my head I think you'd need to use a Rich Text Control of some description or, perhaps, FCK Editor (I would link it for you but I'm being blocked form Source Forge for an unkinown reason (me not them)). Anyway, look at those unless anyone has a better solution.Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
ASP.net doesn't have rich textbox control. It is in windows form.
|
|
|
|
|
hence 'of some description'. Try the FCK Editor or similar.Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
I'll bet there's a jQuery extension for that.
|
|
|
|
|
how could i change dynamically the hyperlink look & behavior using css. suppose for few users i will show hyperlink and for few users i will show label. i think hyperlink can behave like label if proper css can be use. so if possible please someone give me a snippet of css which will make a hyperlink a just label.
thanks in advancetbhattacharjee
|
|
|
|
|
Why dont you use label and link and Show/Hide them according your requirement. Cheers!!
Brij
|
|
|
|
|
Hello Friends,
I've a tab control in my form. and a GridView When click on the Select commaqnd of GridView then it's not displaying my tabcontrol and throwing a javascript error as shown below
Sys.ArgumentNullException: Value cannot be null.
Parmeter name: element
|
|
|
|
|
hi
i hav a problem on logout.after logout when i click on back button it show me the page from where i logout.
plZ help me how to solve it.
|
|
|
|
|
|
actualy i have problem on opera and firefox browser.my code is work good in IE.Back Button of opera and firefox is working after logout.
|
|
|
|
|
Assuming you're using formsauthentication and not something homecooked:
FormsAuthentication.SignoutMy postings are a natural product. The slight variations in spelling and grammar enhance their individual character and beauty and are in no way to be considered flaws or defects.
|
|
|
|
|
For the login control that I am using, there is a connectionstring which is automatically created in the web.config file.
I ran an .exe file which populated the specified database with all the asp login related tables and stored procedures...
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=localmachineName;Initial Catalog=DBName;Persist Security Info=True;User ID=DBUserName;Password=password" providerName="System.Data.SqlClient"/>
</connectionStrings>
Question:
How can I point the login control to a different Database based on the database selection by a user i.e. the user can change the name of the database and so the login should point to that database.
Thanks
|
|
|
|