|
Hi all,
I have some queries
I have put one check box in grid.
as
<asp:templatefield headertext="Select">
<itemstyle horizontalalign="Center" width="50px">
<headerstyle width="70px" cssclass="heading">
<itemtemplate>
<asp:checkbox id="chkSelect" runat="server" cssclass="text" oncheckedchanged="Check_Clicked">
On click of this check box in the grid some event will fire
Which event is that
Can anybody tell
Thanks in advance
|
|
|
|
|
Try this:
<asp:TemplateField HeaderText="Add">
<ItemStyle HorizontalAlign="Center" Width="50px" />
<HeaderStyle Width="70px" CssClass="heading" />
<ItemTemplate>
<asp:CheckBox ID="chkAdd" runat="server" AutoPostBack=true OnCheckedChanged="chkAdd_Changed" CssClass="text"/>
</ItemTemplate>
</asp:TemplateField>
On Code Behind do this:
Protected Sub chkAllAdd_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkAllAdd.CheckedChanged
Dim gvRow As GridViewRow
For Each gvRow In GridViewForm.Rows
If gvRow.RowType = ListItemType.Item Or gvRow.RowType = ListItemType.AlternatingItem Then
If chkAllAdd.Checked = True Then
CType(gvRow.FindControl("chkAdd"), CheckBox).Checked = True
CType(gvRow.FindControl("chkView"), CheckBox).Checked = True
If chkAllModify.Checked = True And chkAllView.Checked = True And chkAllDelete.Checked = True Then
chkAllPermission.Checked = True
End If
Else
CType(gvRow.FindControl("chkAdd"), CheckBox).Checked = False
chkAllPermission.Checked = False
End If
End If
Next
If chkAllAdd.Checked = True Then
chkAllView.Checked = True
End If
End Sub
Hope this helps u???
|
|
|
|
|
Hi to All,
I display the data in DataGrid and I put bottom columns(Edit, Update, Cancel and Delete).
Now, I want using javascript To validate the user input. Like Numeric Only and when User click Update that time i want to confirmation.
Mkanchha
|
|
|
|
|
You need Javascript for time validation ie., while updating the record.
Regards,
Satips.
|
|
|
|
|
I would recommend converting your GridView columns to templates and then attach appropriate JScript handlers to input fields.
|
|
|
|
|
You might consider using Validation controls within templates to avoid messing with JScript.
|
|
|
|
|
Hi,
Can any one of you give me some online Sites/examples Developed in ASP.NET using Webparts and using catalog zones.
I am having some doubts in designing and coding catalog zones. I think some online live examples can help in understanding the scope of catalog zones.
Many Thanks,
Jagadeesh
|
|
|
|
|
By Using the Web Parts - catalog zone what problem you are facing. ie., the easy application.
For more details about web parts catalog zone[^].
Hope this will help you.
Regards,
Satips.
|
|
|
|
|
I'm planning a web site very much similar to this "http://www.google.co.in/ig?hl=en" using webparts in ASP.NET 2.0
I want the catalog manager look some thing similar to igoogle --> "Make it your own" page. The catalog manager should not ask me to which webpartzone my controls need to be added. It should select some random webpartzone to add the control.
Also, How to make webparts work in FIREFOX?
I am new to new to .NET programming. If this is fundamental please be patient and let me know your feedback.
Regards,
Jagadeesh
|
|
|
|
|
Hello there,
I need to monitor changes made to a certain file from ASP.NET website application. I decided to accomplish this using System.IO.FileSystemWatcher. Currently I am having the following problems
1. I can't make my watcher monitor a single file not just the whole folder content.
2. Even if I try the whole-folder-monitoring scenario it turns out that the Change event fires 5 times instead of 1. Any magic behind this number?
Here's the source code inside my Global.asax file. Commented lines include adjustments I tried to enable monitoring specific file.
<br />
1 void Application_Start(object sender, EventArgs e)<br />
2 {<br />
3
4<br />
5<br />
6<br />
7 System.IO.FileSystemWatcher __file_watcher = new System.IO.FileSystemWatcher();<br />
8 Application.Add("AdConfigurationWatcher",__file_watcher);<br />
9 __file_watcher.Path = Server.MapPath("~/");<br />
10 __file_watcher.IncludeSubdirectories = false;<br />
11 __file_watcher.NotifyFilter = System.IO.NotifyFilters.LastWrite;<br />
12
13<br />
14<br />
15 __file_watcher.Changed += new System.IO.FileSystemEventHandler(__file_watcher_Changed);<br />
16<br />
17 __file_watcher.EnableRaisingEvents = true;<br />
18 }<br />
19<br />
20 void __file_watcher_Changed(object sender, System.IO.FileSystemEventArgs e)<br />
21 {<br />
22
23 System.IO.WatcherChangeTypes c = e.ChangeType;<br />
24 }<br />
25<br />
26 void Application_End(object sender, EventArgs e)<br />
27 {<br />
28
29 System.IO.FileSystemWatcher __file_watcher = Application["AdConfigurationWatcher"] as System.IO.FileSystemWatcher;<br />
30 Application.Remove("AdConfigurationWatcher");<br />
31 __file_watcher.Dispose();<br />
32 } <br />
|
|
|
|
|
Hi All,
Can we use Server.MapPath in ASP.NET with C# Window Based Application
|
|
|
|
|
Use this instead :-
System.AppDomain.CurrentDomain.BaseDirectory.ToString
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hi All,
I want to store images in a folder named "Upload" at runtime by browsing
and also it's path in MS-Access or SQL Server 2000
So that whenever i call or click over it's path the corresponding images should be displayed
Thnx in Advance
|
|
|
|
|
Hi,
What is the problem?
Did you stuck any where?...
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
Well, if that's what you want, then do it. What bit is causing you grief ? You store the paths in the DB ( that's trivial ) and you put links to the images in your page, or if you want them to show inside a page, put them there to start with and show/hide them with javascript.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
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...
|
|
|
|