|
Hello frnd
I displayed database(student marklist) value in data grid,if i click the cell value(like roll number) i want to display all the detail about that cell(roll number,mark,name) in text box.I am new for asp.net plz any one give come sample coding for this.I am using ASP.net 1.1
|
|
|
|
|
I can give you some idea not code.
while select one row, use GridviewRow class and and read the row of corrosponding selected index and then use can use textbox1.text=GR.column[0].text like that
Try this concept it will work
|
|
|
|
|
thank u for replay.
frnd i have one doubt how to find selected row? and how to write onclick event for data grid?
|
|
|
|
|
hi,
insert Select column (checkbox)as the first column in ur datagrid, so it will be at begining of each row,
if it is checked means selectd nd u can progress further
write a bool func isChecked(){}
try it ll definately work
i m faisal
|
|
|
|
|
Hi,
Please anybody give me a good method for handling session timeout...i mean after session time out user will redirect to some pages...
regards
alex.
|
|
|
|
|
use can use it inside web.config
|
|
|
|
|
Hi,
I didn't get correctly..can you pls tell me little bit clearly...
thanks Alex.
|
|
|
|
|
Global.ASAX?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Hi,
I have uploaded a image with some data in a reg. from. so datas are going to the respective table and images are going to the respective folder,
now i want to retrive that folder images in separate form, can u pls help me...
krishna
|
|
|
|
|
|
Thanx for ur information... i will check and get u back.
krishna
|
|
|
|
|
Iam using mssql, its support?
krishna
|
|
|
|
|
I have involved in developing my first Ajax .Net project and after nearly completing the project we have been testing performance of our application. We have found that the Ajax RoundedCornersExtender has a serious effect on the performance of our application and we improved query results from 4-5 seconds to less than a second by taking it out.
Thanks to firebug we isolated this. I really wish the toolkit controls where thoroughly tested before release.
Anyway, just thought I would share.
Jared
|
|
|
|
|
I have a master page that contains a simple table. There is probably a 10 pixel space between both the top and left sides of the screen. How do I remove this spacing?
I have tried div and table padding spacing? Any other suggestions?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Found it, I needed to set the style on the body tag. Thought about that about 5 seconds after posting.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
hi everyone
i am desighning a global application in which i need to create a module of country-state and city module but i am having trouble
For example
http://msn.careerbuilder.com/jobseeker/resumes/postresumenew/postresumestart.aspx
If u just give any name and some text in covernote the next step will give u example of what i want and this can help me and many others...because with others i can cope with but with united kingdom post code its different story
|
|
|
|
|
This is a public site, most everything is of use to more than just one person
Are you asking how to create a dropdown with states and counties ?
only two letters away from being an asset
|
|
|
|
|
yes please but like it mathces to address for every country and good concept of storing that in sql database with search aspects
|
|
|
|
|
Hi, I am making an ASP.NET site with a menu on the side. The menu items are loaded from a database, and the items themselves are hyperlinks(at the moment) created dynamically for each item it finds in the database.
But how do I make the links work? I could just set the URL of it but I am just redirecting to the same page. When that page loads I want it to be able to tell what they just clicked(or if they just came to the site) and generate the content from there.
So I though maybe I could use sessions and then when the page loads it just checks the session with a couply if statements. Will this work? And if so, how do I do it? I have tried many different ways, but no matter what I try I cannot find a way to make a hyperlink do anything onclick besides going to its url.
Please help me, or if you have a better idea(which im sure you will, im new to this) them please share. Much appreciated.
Regards
Matt
|
|
|
|
|
http://www.devx.com/tips/Tip/5498[^]
You can call javascript from an anchor tag ( a hyperlink )
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Have you looked at the menu control in the toolbox?
only two letters away from being an asset
|
|
|
|
|
Look into DataBinding if I understand you correctly, it is very easy to use a repeater control and use data binding to fill in all the data.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi! I couldnt maintain the state of the treeview after postback. searched all over but i could seem to solve the problem. below is the code that i am using so it will be easier to understand whta i am doing. also i have having problem navigating to the same url with parameter on it. for e.g. if the node id is 5 i want to postback as tree.aspx?id=5
Imports System.Data.SqlClient
Imports System
Imports System.Collections.Generic
Imports System.Web
Imports System.Web.UI.WebControls
Partial Public Class tree
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
PopulateRootLevel()
End If
'TreeView1.CollapseAll()
' get the saved state of all nodes.
Dim treeViewState As New TreeViewState()
treeViewState.SaveTreeView(TreeView1, Me.GetType.ToString())
End Sub
Private Sub PopulateRootLevel()
Dim objConn As New SqlConnection("server=APEX-KEV3;uid=sa;pwd=password2133;database=TaxnologyOnlineDev")
Dim objCommand As New SqlCommand("select LocationId,LocationName,(select count(*) FROM Location " _
& "WHERE parentlocationid=sc.locationid) childnodecount FROM Location sc where parentlocationID is null and locationid=3", _
objConn)
Dim da As New SqlDataAdapter(objCommand)
Dim dt As New DataTable()
da.Fill(dt)
PopulateNodes(dt, TreeView1.Nodes)
End Sub
Private Sub PopulateNodes(ByVal dt As DataTable, ByVal nodes As TreeNodeCollection)
For Each dr As DataRow In dt.Rows
Dim tn As New TreeNode()
tn.Text = dr("locationname").ToString()
tn.Value = dr("locationid").ToString()
nodes.Add(tn)
'If node has child nodes, then enable on-demand populating
tn.PopulateOnDemand = (CInt(dr("childnodecount")) > 0)
Next
End Sub
Private Sub PopulateSubLevel(ByVal parentid As Integer, ByVal parentNode As TreeNode)
Dim objConn As New SqlConnection("server=APEX-KEV3;uid=sa;pwd=password2133;database=TaxnologyOnlineDev")
Dim objCommand As New SqlCommand("select LocationId,LocationName,(select count(*) FROM Location " _
& "WHERE parentlocationid=sc.locationid) childnodecount FROM Location sc where parentlocationID=@parentID", _
objConn)
objCommand.Parameters.Add("@parentID", SqlDbType.Int).Value = parentid
Dim da As New SqlDataAdapter(objCommand)
Dim dt As New DataTable()
da.Fill(dt)
PopulateNodes(dt, parentNode.ChildNodes)
End Sub
Protected Sub TreeView1_TreeNodePopulate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) Handles TreeView1.TreeNodePopulate
PopulateSubLevel(CInt(e.Node.Value), e.Node)
End Sub
Protected Sub TreeView1_SelectedNodeChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TreeView1.SelectedNodeChanged
If TreeView1.SelectedNode.Value <> String.Empty Then
Response.Redirect("tree.aspx?id=" + TreeView1.SelectedNode.Value)
End If
End Sub
Protected Sub TreeView1_Unload(ByVal sender As Object, ByVal e As EventArgs) Handles TreeView1.Unload
' save the state of all nodes.
Dim tvs As New TreeViewState
tvs.SaveTreeView(TreeView1, Me.GetType().ToString())
End Sub
End Class
Public Class TreeViewState
Public Sub SaveTreeView(ByVal treeView As TreeView, ByVal key As String)
Dim list As New List(Of System.Nullable(Of Boolean))()
SaveTreeViewExpandedState(treeView.Nodes, list)
HttpContext.Current.Session(key + treeView.ID) = list
End Sub
Private RestoreTreeViewIndex As Integer
Public Sub RestoreTreeView(ByVal treeView As TreeView, ByVal key As String)
Dim list As New List(Of Nullable(Of Boolean))
If HttpContext.Current.Session(key + treeView.ID) IsNot Nothing Then
list = CType(HttpContext.Current.Session(key + treeView.ID), List(Of Nullable(Of Boolean)))
End If
RestoreTreeViewIndex = 0
RestoreTreeViewExpandedState(treeView.Nodes, list)
End Sub
Private Sub SaveTreeViewExpandedState(ByVal nodes As TreeNodeCollection, ByVal list As List(Of System.Nullable(Of Boolean)))
For Each node As TreeNode In nodes
list.Add(node.Expanded)
If node.ChildNodes.Count > 0 Then
SaveTreeViewExpandedState(node.ChildNodes, list)
End If
Next
End Sub
Private Sub RestoreTreeViewExpandedState(ByVal nodes As TreeNodeCollection, ByVal list As List(Of System.Nullable(Of Boolean)))
For Each node As TreeNode In nodes
If RestoreTreeViewIndex >= list.Count Then
Exit For
End If
node.Expanded = list(System.Math.Max(System.Threading.Interlocked.Increment(RestoreTreeViewIndex), RestoreTreeViewIndex - 1))
If node.ChildNodes.Count > 0 Then
RestoreTreeViewExpandedState(node.ChildNodes, list)
End If
Next
End Sub
End Class
i am using visual studio .net 2.0 treeview control
please help
thanks
|
|
|
|
|
You don't need to create a class to do what is already available. EnableViewState = true
only two letters away from being an asset
|
|
|
|
|
hi!
enableviewstate is by default made true for treeview control. may be i have misunderstood what you are trying to say. could you please explain me in detail?
originally the page loads as "tree.aspx". each node has its id and value(which is an integer) all i am trying to do is display a datagrid on the left based on the node they select. lets say if they select sub node of id 5. I am tryign to maintain that expanded subnode plus redirect as
tree.aspx?id=5 (based on which the grid will be filtered. please note the treeview is in left.ascx and grid is in tree.aspx.
please help
thanks in advance
-- modified at 19:45 Wednesday 14th November, 2007
|
|
|
|