|
Hi
My grid has biunded columns and it sort on ascending but not on Desc
Please help me in this i think after desc it is not able to display data.
Thanks
Snippets of Code is given
In my page Load i write
ViewState["SortOrder"] = "";
public void doSortDataGridItem(object sender , System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
showReportsDetails();
dvDetails =dsDataset.Tables[0].DefaultView;
if(ViewState["SortOrder"].ToString() == "" || ViewState["SortOrder"].ToString) == "DESC")
{
// DataView Name dvDetails
dvDetails .Sort = e.SortExpression;
//Change history no 9
ViewState["SortExpression"]= e.SortExpression;
//End Change history no 9
ViewState["SortOrder"] = "ASC";
}
else
{ // DataView Name dvDetails
dvDetails .Sort = e.SortExpression + " DESC";
//Change history no 9
ViewState["SortExpression"]= e.SortExpression + " DESC";
/End Change history no 9
ViewState["SortOrder"] = "DESC";
}
dgHistory.DataBind();
}//End of this event.
showReportsDetails() this is used to display data in datagrid
showReportsDetails()
{
dsDataset=SqlHelper.ExecuteDataset(com.sConnectionString(),CommandType.StoredProcedure,"SP_Reporting1",oSqlParameter);
dgHistory.DataSource=dsDataset.Tables[0].DefaultView;
dgHistory.DataBind();
}
|
|
|
|
|
have a look at This[^]
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
Hi
Thanks for Reply
But;
What to write for ME keyword or if i write that property then
where to write it.
|
|
|
|
|
It's easy. Because you have write:
ViewState["SortOrder"] = ""; in Page load
So everytime it will make if(ViewState["SortOrder"].ToString() == "") true
I think you may write this in page load :
if(ViewState["SortOrder"]==null)
{
ViewState["SortOrder"] = "";
}
Hope it works.
Regards,
Mayank Parmar
Senior Software Engineer
Amba Tech
Gandhinagar, India
|
|
|
|
|
Hi I have 2 webforms in my project.say
webform 1-----------> txtno
webform 2----------->txtEno
I need to compare the values in the both textbixes in webform2 in the button click event.If both the values are different then only submit the form.
I need javascript function which require to compare both values but don't use form id .
This is very urgent Thanks to all.
|
|
|
|
|
u can pass this txtno value thro query string and then use javascript function to compare the values...
Hope this helps u...
|
|
|
|
|
Hi Sagar
try this
1) write a javascript code to add textbox value of webForm1 in cookie or querystring
eg in Cookies we can do in this way
<br />
<script language=javascript><br />
function getvalue()<br />
{<br />
var val=document.getElementById("TextBox1").value;<br />
document.cookie=val;<br />
<br />
}<br />
<br />
</script><br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
Button1.Attributes.Add("OnClick", "javascript:getvalue();");<br />
<br />
}<br />
Now in webform2 only compare two value
<br />
<script language=javascript ><br />
function compare()<br />
{<br />
<br />
var textbox2=document.getElementById("TextBox1").value;<br />
var txtbx1=document.cookie;<br />
var value=txtbx1.split(';');<br />
<br />
if(textbox2==value[0]) <br />
{<br />
alert("Both are same values");<br />
return true;<br />
}<br />
else <br />
{<br />
alert("Don't submit the form");<br />
return false;<br />
}<br />
<br />
}<br />
<br />
</script><br />
Donit forget to write return statement in code file like this
<br />
Button1.Attributes.Add("OnClick", "javascript:return compare();");<br />
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hi Thanks for your reply ,But pls help me again.I am using single javascript file for comparing both.Pls modify my code and tell me where I have done mistake.
webform1: only contains textbox and button .In the button click()
---------
Response.Redirect("two.aspx?id=" & TextBox1.Text)
webform2.aspx
-------------
contains one textbox and HTMLbutton.
page_load() : dim a as string =Request.querystring("id")
----------
I created button in the click i called javascript cfunction
I wrote code like this IN JAVASCRIPT it is displaying error for both conditions pls check my code
function abcd(str1,str2)
{
var a = document.getElementById("str1").value;
var b = document.getElementById("str2").value;
if(a==b)
{
alert('Pls enter another');
}
}
|
|
|
|
|
HI
siddisagar wrote: function abcd(str1,str2)
What is str1 and str2 ?
where the query string value that you are storing in page load ?
what error are you getting ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hey try this
<br />
<script language=javascript ><br />
function compare(querystring)<br />
{<br />
<br />
var textbox2=document.getElementById("TextBox1").value;<br />
if(textbox2==querystring) <br />
{<br />
alert("Both are same values");<br />
return true;<br />
}<br />
else <br />
{<br />
alert("Don't submit the form");<br />
return false;<br />
}<br />
<br />
}<br />
add this in page load of the code file
<br />
string query = Request.QueryString["id"];<br />
Button1.Attributes.Add("OnClick", "javascript:return compare(" + query+ ");");<br />
i think this will solve your problem
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hey Thanks.Pls solve my new question
I have 10 pages in my project.In that webform1.aspx contains Empno textbox.I need this value in webform4.aspx.Pls tell me how to get First page textbox value in fourth page.I am navigating pages in 1,2,3,4 etc
Don't tell session .Tell me Other than session .Pls tell me different ways ?
Thanks.
|
|
|
|
|
siddisagar wrote: Don't tell session
sending through Querystring can be an option. But you may have to maintained it through all the pages.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Pass the webform1 value into webform2 using (cookies, or querystrings or sessions or application object depends on requuirement) In the webform to Page_Load event you can get it.
Declare the variable static and compare with the textbox value in the webform button click event.............
If(var != Textbox.Text) //where var is, webform1 value retrived at webform2
{
// submitt form
}
the above code written in the script tag in in the Html page
kishore kumar Manikonda
Software Developer
|
|
|
|
|
Hi
Plz help me ,how to create login page in asp.net 2.0 with C#
Plz send me all code to my email id. carecareer@gmail.com.
Thanks
Care Career
|
|
|
|
|
Hey, we are not here to do your work.
Pls try it and tell us what error you get and we are here to help you in all aspects.
Regards,
Satips.
|
|
|
|
|
Use Login control which is in ASP.net 2.0
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Thanks for replay
Regards
Care Career
|
|
|
|
|
Hi
I have used this but how to write code in ok button.& wht code i have to write tell me
Thanks
Care Career
|
|
|
|
|
Double click on that control u will get the user name and password with that control name ex: ur control name is userLogin
So u will get userLogin.UserName and userLogin.Password and rest all u know...
|
|
|
|
|
Hey just click on the button you will be redirected to the code page and on button1_Click you can write code what you want ie., allow the user to login to the website after entering the valid Email Id and password.
Regards,
Satips.
|
|
|
|
|
if(username == "you" && password == "oh")
{
// good login
}else{
// bad login
}
ghehe =D
Stef
|
|
|
|
|
iam new to asp.net,please tell me the procedure to create virtual directory.after selecting visualbasic projects and selecting asp.net web application, it is showing a message box "visual studio.net cannot create or open the application"
|
|
|
|
|
Are you using VS.Net 2003 ? If yes, check your IIS is installed and running before creating a web app.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
yes Mr coolest iam using VS.Net 2003 and configured iis, the problem is ,it is showing a msgbox"upgrade ur asp.net1.0 to asp.net1.1(Recommende)".
How to do this.
thankx
|
|
|
|
|
Hi All,
I am developing a web site where I need to send mails to all admin users if any normal user doesn't login the site for more than 15 days.
Please help me its urgent...
Thanks in advance...
|
|
|
|