|
Hai all,,
Actually i got a grid control on which am displaying some content from the database..by using the template columns....i have bounded the content with the datagrid in such a way that information in the all the rows is editable(say 10 rows each of 3 columns) i.e by placeing textbox in the itemtemplate....Know whats the problem is--->am using a button(only one) in the footer of the grid ...while i clicked on the button i want to update the database with the updated information in the editable textboxes(all the content)..plz help me out or send me any article related to this
|
|
|
|
|
Hi Yuvachandra,
Why you are displaying all data in textboxes.
If you need that there will happen unwanted data changes.Am I right?
If you want to find which textbox is changed,You should iterate through all.
So if dimension is 10x3 you should make 30 iteration.If the direction is
bigger than that???(it is possible to do but...time...complexity..)
I think, you know that there is a provision in grid that, we can make a
Particular row to be editable.
I think it is better to go on that way.
And now also, if you really need it.....Post... we will try...
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
ya...it is compulsary,,bcz there is a scenarion that i ahve to expose all the content to my enduser..anyhow i finded the solution.....Thanks for ur kind reply...
this is the code i used
foreach(DataGridItem val in DataGrid1.Items)
{
string st,st1,st2;
st=((Label)val.Cells[0].FindControl("lblAccountId")).Text;
st1=((TextBox)val.Cells[1].FindControl("AccCode")).Text;
st2=((TextBox)val.Cells[2].FindControl("Descrip")).Text;
dataAdapter=new SqlDataAdapter("update AccountCode set AccountCode='" + st1 + "',Description='" + st2 + "'where AccountId=" + st,con);
dataAdapter.Fill(ds,"contentTable");
}
|
|
|
|
|
Hi,
It is a good work.
But the text box is not changed also, it will update.
That means if I've 10 rows and I changed only first row.It will try to
update all the 10 rows.Is that you really need?
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
that's wasn't i mean..but this is kind of situation( i even contradict with mt lead )we must and should expose all the boxes to be editable though he may update 1 or 2 boxes of many(ofcourse it's a unnesessary burdon,i know) ..anyhow thanqs for ur kind and honest replay
|
|
|
|
|
Hi All. Iam new to asp.net.
I want to know how can we determine that session is alive or expired.
Actually I created a session Session["LoogeIn"] when user logs In, and I used this session across the application.But when saving or updating records , it gives Error if Session is expired ( I am using Session when savinf or updating records.)
So I am confused how can I determine that whether Session is expired or not.
And In case of Expire I want to redirect the page to login page, so session can start again.
Thanks in advance.
bye
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
If the session has expired, the user will get a new Session object, where the Items collection is empty. When you try to read a value from the empty collection you will get a null value, so you just have to check for that.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hey you have to check the sessions if they are empty during the page load event. write the below code on page load event
If session("YOUR_SESSION_VARIABLE") = "" then
response.redirect("LOGIN_PAGE_URL")
End If
Try this out.....
Regards,
Kaps
|
|
|
|
|
You can also use the global.asax and use the session time out method. With that you can redirect the user to a login page or a 'default' page for session timeout information.
e.g.,
// this is inside the global.asax
void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised
Server.Transfer("login.aspx");
}
why Server.Transfer?
here is more info on the do's and dont's
http://www.developer.com/net/asp/article.php/3299641[^]
|
|
|
|
|
hi...
how to display the value of checkbox, which is cheked..using javascript...
note: i may have more than 100 checkbox,i may check any number...
|
|
|
|
|
Make sure that all your checkbox have same name suppose "Sandeep"
<br />
(Assuming the checkbox are html control not Asp Control)<br />
<input type=CheckBox ID="First" value="127" name="Sandeep" onclick="CheckThis();" /><br />
<input type=CheckBox ID="CheckBox9" value="126" name="Sandeep" onclick="CheckThis();" /><br />
<input type=CheckBox ID="CheckBox10" value="103" name="Sandeep" onclick="CheckThis();" /><br />
<input type=CheckBox ID="CheckBox11" value="151" name="Sandeep" onclick="CheckThis();" /><br />
<input type=CheckBox ID="CheckBox12" value="190" name="Sandeep" onclick="CheckThis();" /><br />
<input type=CheckBox ID="CheckBox13" value="163" name="Sandeep" onclick="CheckThis();" /><br />
<input type=CheckBox ID="CheckBox14" value="125" name="Sandeep" onclick="CheckThis();" /><br />
Now time to write javascript
<br />
function CheckThis()<br />
{<br />
<br />
alert('Sanaslfndsaf');<br />
var object =document.getElementsByName("Sandeep");<br />
for(var index=0;index<object.length;index++)<br />
{<br />
alert(" value"+object[index].value );<br />
if(object[index].checked)<br />
{<br />
alert("this is checked ");<br />
}<br />
}<br />
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
|
hello,
I got one bug in my site developed using C# and asp.net
If we right clicked on the LinklButton We get Options like "Open in new window and Open in new Tab" in case of IE (7.0). But when we select one of them, say tab,then page doesn't open actually in new tab but it opens in the same tab.
same if we selectd open in new window it opens in the same window.
Moreover in case of Mozilla Firefox browser we don't even get options like "Open in new window and Open in new tab".
If we use Hyperlink then both these options work fine on both the browsers.
But Hyperlink control doesn't have Click event so we can't use it.
So two meet both the requirements what to do.
Hope you undrstood my problem. Please guide.
Thank you.
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
The LinkButton isn't strictly speaking a normal hyperlink, it runs some javascript in the onlick event that causes the form to post back. Firefox correctly realises this and doesn't give you the "open in new tab" option, and in IE it doesn't work because there is no link to open, only the code to run when its clicked (which it what happens).
Short answer is that "open in new tab" will only work for navigational links (ie ones that actually point to another URL).
The ASP HyperLink control doesn't have a click event because its supposed to be used for naviation, although if you use an HTML <a> tag with runat="server" you will get an onserverclick event (which basically turns it into a LinkButton).
What are you trying to use the LinkButton for? Are you running some code in the Click handler or just redirect?
|
|
|
|
|
Hello,
I have to migrate my asp.net 1.1 application to 2.0
in 1.1 i have use Cache to store HasheTable and this scenario work
fine in 1.1 but above case not work in ASP.NET 2.0 some time means
cache may be clear sometimes not every time.please give me a solumn
rahulpatel
|
|
|
|
|
Why are you using the Cache ?
There are many ways to store value
you can use Viewstate,Session,or create a datacontainer class that will store the list of objects and do state management
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
but i need above answer of the cache bcoz its problem in live site and want to fix imediately
|
|
|
|
|
I set my control tabindex from the first control to teh last control on my web form. On running the webform, and pressing teh tab to move from one control or the other, after the first control, it jumps to the address bar of the internat explorer
Any help will be appreciated
t.aransiola
|
|
|
|
|
Hi
Just set tab index of all controls to 0. By default tab will come automatically in order of the links, address bar, controls and buttons etc..
Harini
|
|
|
|
|
Hi...
If i press signout i am redirecting to logout page, there if i click browser back button then it is was showing all the previous pages which i navigated through from login page.
To avoid this i used fallowing code in the page_load event of all the pages which i dont want to show when i click browser back button.
Response.Buffer=true;
Response.ExpiresAbsolute=DateTime.Now.AddDays(-1d);
Response.Expires = -1500;
Response.CacheControl ="no-cache";
But my problem is, when i press sign out button and then if i click browser back button it is not showing the pages which i used above code, but before signout if i press browser back button then also it is not showing the previous pages which i navigated through from login page, i dont want to happen this. when i signout then only i want to happen this.
Like what exactly is happening in yahoomail.com. before signout we can navigate through previous pages using browser back button but not after signout.
Please help me regarding this its very urgent for me...
Pradeep Reddy
|
|
|
|
|
|
thank u...
Pradeep Reddy
|
|
|
|
|
take one aspx page
on html side
on window_onload event of page
write
window.navigate("signin.aspx")
or
window.location.replace("Signin.aspx")
and
in each form
when u signout
redirect to this new page
i hope this will solve ur problem
all the best
|
|
|
|
|
hi sir,
really u saved my life todat. m thankfull to u sir.
Pradeep Reddy
|
|
|
|
|
hi friend I to faced the same problem i found out solution by placing the code in the last page...the one which is before signout one
ADD THIS CODE IN LASTPAGE IT DISABLES BROWSERS BACK BUTTON
if(window.history.forward(1) != null)
window.history.forward(1);
and add a page sign out completely ....
came out of hardwork
|
|
|
|