|
i want help for bind data on dropdown selectedindex_changed event
|
|
|
|
|
Hello Everybody
This is the second time im posting same problem.
What I want to do is, On my gridView I have a linkButton name linkSelect if you click it then will send memberID for memberDetails (which will fill details view inside a panel called by popup extender)
Im giving you my code:
ASPX CODE FOR GridView:
<asp:GridView ID="gvBorrowedBooks" runat="server" AutoGenerateColumns="False" Style="font-size: small;
font-family: Verdana" Width="100%" Visible="False">
<Columns>
<asp:TemplateField HeaderText="Sl.No.">
<ItemTemplate>
<asp:Label ID="lblSlNo" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="MemberID">
<ItemTemplate>
<asp:HyperLink ID="linkMemberID" runat="server">[linkMemberID]</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="BookID">
<ItemTemplate>
<asp:HyperLink ID="linkBookID" runat="server">[linkBookID]</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Due Date">
<ItemTemplate>
<asp:Label ID="lblDueDate" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delay">
<ItemTemplate>
<asp:Label ID="lblDaysDelay" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="linkSelect" runat="server" ForeColor="#C04000" CommandName="Select" >Select</asp:LinkButton>
<cc1:ModalPopupExtender ID="mpeDetails" runat="server" TargetControlID="linkSelect" PopupControlID ="pnlDetails" CancelControlID ="ibtnOK">
</cc1:ModalPopupExtender>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="Blue" Font-Size="X-Small" ForeColor="White" HorizontalAlign="Center"
VerticalAlign="Top" />
<AlternatingRowStyle BackColor="Silver" />
<RowStyle BackColor="#9999FF" Font-Size="X-Small" HorizontalAlign="Center" VerticalAlign="Middle" />
<EditRowStyle Font-Size="X-Small" HorizontalAlign="Center" />
</asp:GridView>
ASPX CODE For DetailsView which is inside the panel
<asp:Panel ID="pnlDetails" runat="server" CssClass="modalPopup" style="display :none ; vertical-align: top; text-align: left;" Width="380px">
<table style="width: 100%">
<tr>
<td colspan="3">
<span style="font-size: 8pt; font-family: Verdana">Details information about member
and book</span></td>
</tr>
<tr>
<td colspan="3">
<asp:DetailsView ID="dvBooksMembers" runat="server" BackColor="White" BorderColor="#3366CC"
BorderStyle="None" BorderWidth="1px" CellPadding="4" Width="100%">
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<EditRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<RowStyle BackColor="White" ForeColor="#003399" />
<PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
<HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
</asp:DetailsView>
</td>
</tr>
<tr>
<td style="width: 100px">
<asp:ImageButton ID="ibtnOK" runat="server" ImageUrl="~/Reports/images/ok_22.gif" /></td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
</table>
</asp:Panel>
CODE BEHIND
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
lblMessage.Text = ""
gvBorrowedBooks.Visible = False
Dim _bbMembersList As bbMemberList = _bbMemberData.BorrowedBooksMembers()
If Not _bbMembersList.Count = 0 Then
gvBorrowedBooks.Visible = True
gvBorrowedBooks.DataSource = _bbMembersList
gvBorrowedBooks.DataBind()
Else
lblMessage.Text = "No Borrowers Found !!"
End If
End Sub
Protected Sub gvBorrowedBooks_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvBorrowedBooks.RowDataBound
Dim _bbMembers As bbMember = New bbMember()
_bbMembers = CType(e.Row.DataItem, bbMember)
If _bbMembers Is Nothing Then
Else
Dim lblSlNo As Label = e.Row.FindControl("lblSlNo")
Dim linkMemberID As HyperLink = e.Row.FindControl("linkMemberID")
Dim linkBookID As HyperLink = e.Row.FindControl("linkBookID")
Dim lblDueDate As Label = e.Row.FindControl("lblDueDate")
Dim lblDaysDelay As Label = e.Row.FindControl("lblDaysDelay")
'Dim linkSelect As LinkButton = e.Row.FindControl("linkSelect")
lblSlNo.Text = _bbMembers.SlNo.ToString()
linkMemberID.Text = _bbMembers.MemberID.ToString()
linkBookID.Text = _bbMembers.BooksID.ToString()
lblDueDate.Text = _bbMembers.DueDate.ToString()
lblDaysDelay.Text = _bbMembers.DaysDelay.ToString()
' I want to put some code here like if click the linkSelect then it will pass selected memberID to fill details view
End If
End Sub
Protected Sub FillMemberDetails(i want to send memberID here when i click linkSelect button)
Dim row As GridViewRow = gvBorrowedBooks.SelectedRow
Dim conn As SqlConnection = New SqlConnection(Web.Configuration.WebConfigurationManager.ConnectionStrings("TCCLMS").ConnectionString)
Dim queryString As String = "SELECT MEMBERID as 'Member ID:', FIRSTNAME +' '+ LASTNAME AS 'Member Name:', Email as 'Email:', ContactNo as 'Contact No:' From Members Where MemberID = '" & _MemberID & "'"
Try
conn.Open()
Dim comm As SqlCommand = New SqlCommand(queryString, conn)
Dim _dataReader As SqlDataReader = comm.ExecuteReader()
dvBooksMembers.DataSource = _dataReader
dvBooksMembers.DataBind()
conn.Close()
Catch ex As Exception
conn.Close()
End Try
End Sub
Sarfarj Ahmed
|
|
|
|
|
Sarfaraj Ahmed wrote: Protected Sub FillMemberDetails(i want to send memberID here when i click linkSelect button)
Set LinkButton.CommandArgument = _bbMembers.MemberID.ToString()
in the GridView_RowDataBound function and fetch this memberID in the RowCommand Event like
dim memberID as string = e.CommandArgument
Now call the Protected Sub FillMemberDetails(memberID) function in the RowCommand event.
Hope this works for you!!
|
|
|
|
|
thank you very much for your help
Sarfarj Ahmed
|
|
|
|
|
How can we deploy a Asp.net 1.1 project with only .aspx files and no code behind should be present in the deployed project. I don`t wan`t to show code files..
can any one help pls
|
|
|
|
|
Just build the website and copy only ASPX pages,bin directory and config files. No need to supply source code
|
|
|
|
|
I have a below Label:
<asp:label id="DateFromLabel" runat="server" style="visibility: hidden" text="From: ">
I have to write a code to set its visibility to true and false. Hence I am using the Javascript as below
function makeVisible()
{
var dtfromlabel = document.getElementById('<% =DateFromLabel.ClientID %>');
dtfromlabel.style.visibility='visible';
}
The above code works perfect but If I try to pass a variable it doesn;t work? I am passing the variable as below
DateFromToCombo.Attributes.Add("onChange"," makeVisible('<%=DateFromLabel.ClientID%>')");
Please suggest me as it will help me to remove the javascript ffrom the code and place in .JS file. What is the issue with passing a variable?
Regards,
Pavas
-----------------------
[http://longjump.com/]
Dynamic business applications that manage and coordinate teams and information
-----------------------
|
|
|
|
|
mpavas wrote: DateFromToCombo.Attributes.Add("onChange"," makeVisible('<%=DateFromLabel.ClientID%>')");
Have you looked to the viewsource ? Is that coming correctly there ? Are you able to alert the id from makeVisible function ?
|
|
|
|
|
Yes the ID comes properly.
Regards,
Pavas
-----------------------
[http://longjump.com/]
Dynamic business applications that manage and coordinate teams and information
-----------------------
|
|
|
|
|
Opps sorry, When I use alert. It says ID is null or not an object.
Regards,
Pavas
-----------------------
[http://longjump.com/]
Dynamic business applications that manage and coordinate teams and information
-----------------------
|
|
|
|
|
Since you are using id from server side, you can directly write Label.ClientId without specifying it inside scriptlets.
|
|
|
|
|
When I try to it says style is null or not an object. I am really not sure y this is happening
Regards,
Pavas
-----------------------
[http://longjump.com/]
Dynamic business applications that manage and coordinate teams and information
-----------------------
|
|
|
|
|
function makeVisible(lblObj)
{
var dtfromlabel = document.getElementById(lblObj);
dtfromlabel.style.visibility ='visible';
}
DateFromToCombo.Attributes.Add("onChange"," makeVisible('" + DateFromLabel.ClientID + "')");
|
|
|
|
|
mpavas wrote: function makeVisible()
{
var dtfromlabel = document.getElementById('<% =DateFromLabel.ClientID %>');
dtfromlabel.style.visibility='visible';
}
Hi if you are using above function then cant call like below code.
mpavas wrote: DateFromToCombo.Attributes.Add("onChange"," makeVisible('<%=DateFromLabel.ClientID%>')");
change it,
Var ControlID;
function makeVisible(ControlID)<br />
{<br />
var dtfromlabel = document.getElementById(ControlID);<br />
dtfromlabel.style.visibility='visible';<br />
}<br />
But why u r passing ID ? as you can get that id from your function.
R u not getting ID there?
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
I am trying to display data in list box with multi column in asp.net . Can it possible in asp.net
multi column list box . ?
Thanks
Piyush Vardhan Singh
|
|
|
|
|
|
Hi,,,
i finished from implement a class its name ValidationApplicationBlock.css and it has some property to make custom validation on some controls in web page its name ValidationApplicationBlock.aspx also i used Validator Attributes in my implementation for this task instead of using enterprise library configuration tools.because it does the same work but with visual tool so i prefer to make my custom validation with Validator Attributes,but you should to set property (sourcetypename) in web form to define the control to its property and Validator Attributes i try to do that more then one time and change the path for ValidationapplicationBlock.css to define it to web form but no result so please help me
ASAP to solve that ,and the error is
Server Error in '/PresentationWeb' Application.
The source type could not be found for name "/PresentationWeb/App_Code/Pages/ValidationApplicationBlock".
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The source type could not be found for name "/PresentationWeb/App_Code/Pages/ValidationApplicationBlock".
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: The source type could not be found for name "/PresentationWeb/App_Code/Pages/ValidationApplicationBlock".]
Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet.PropertyProxyValidator.Microsoft.Practices.EnterpriseLibrary.Validation.Integration.IValidationIntegrationProxy.get_ValidatedType
() +181
Microsoft.Practices.EnterpriseLibrary.Validation.Integration.ValidationIntegrationHelper..ctor(IValidationIntegrationProxy integrationProxy) +21
Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet.PropertyProxyValidator.EvaluateIsValid
() +25
System.Web.UI.WebControls.BaseValidator.Validate() +86
System.Web.UI.Page.Validate() +133
System.Web.UI.Page.Validate(String validationGroup) +2049947
System.Web.UI.WebControls.Button.RaisePostBackEvent
(String eventArgument) +81
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
|
|
|
|
|
hi all,
hi problem as follows,
previously we are using to upload the documents inside the virtual folder only . now client want to crate the folder out of virtual directory .i am able to create the directory .but unable to retrieve the files from that directory .i am using grid view in item template using the hyper link binding the physical path to it. but it is not opening the file and not giving any error also .
Please help me in this .if u have any reference links please let me know i am trying in Google unable to find the proper solution. please help in this.
Thanks And Regards,
Guru
|
|
|
|
|
Hi,
do you set this ?
you must have use templatefield and in that you have added hyperlink.
Now in the navigate URL pass full path of file.
like http://servername/foldername/filename.ext
And debug what file name you are passing in hyperlink.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
hi rays,
i am passing "file:///D:/FNTPlacer/Documents/TEST/TestCases.txt"
even through it is not working.
Thanks And Regards,
Guru
|
|
|
|
|
hi,
I am using the reports in my web application using c# in .net 2005
I have created a dataset
then i added a new rdlc file to my website
i couldnt find the Report Item tab in the toolbox dats needed for my report.rdlc design....
I dont know wat i am missing can anybody help me out
thanx in advance
zaree
modified on Monday, December 10, 2007 5:29:13 AM
|
|
|
|
|
Hi all,
I am trying to download a zip file from the server to the mobile device and extract it there with an aspx.
Could any one have idea how it can be done.
Thanks,
Aruna.G
|
|
|
|
|
hi all
i am using a treeview control where checkbox is enabled.
i want to check/uncheck all the nodes if i check/uncheck on the root node.
please help how to do that.
rajeev kumar sharma
vri software pvt. ltd.
new delhi India
|
|
|
|
|
|
Hi,
you can check out this link.
Link[^]
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|