|
What do you mean by Dynamic controls.
Do you mean the controls will be generated inside DataList's ItemTemplate ?
Yes, you can access controls inside
ItemTemplate from codebehind just like I mentioned in my other post. You need to find the control when
ItemDataBound event executes.
<asp:Datalist....OnItemDataBound="Item_Bound" >
<itemtemplate>
<asp:textbox runat="server" id="tb1" />
</itemtemplate>
Now from codebehind :
void Item_Bound(Object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
TextBox tb1 = e.Item.FindControl("tb1") as TextBox;
}
}
Note : You must place Runat = server if you want the control to be found properly using e.Item.FindControl
Hope this clears your doubt.
"Dont forget to click "Good Answer" if it helped you"
|
|
|
|
|
I have a datalist which includes an embedded dropdownlist. The datalist is similar to a simple shopping cart. The dropdownlist is the qty required. I've been able to set the extend price etc, but I'm also trying to set the selected qty of this dropdownlist. It doesn't seem to like any embedded <%# eval()%> in the html. The qty is updated in the database and is returned. This is the html:
===================================================================
<asp:DropDownList ID="ddlQty" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlQty_Changed" >
<asp:listitem runat="server" value="1" Selected='<%# Eval("itemqty")==1 %>' />
<asp:listitem runat="server" value="2" Selected='<%# Eval("itemqty")==2 %>' />
<asp:listitem runat="server" value="3" Selected='<%# Eval("itemqty")==3 %>' />
<asp:listitem runat="server" value="4" Selected='<%# Eval("itemqty")==4 %>' />
<asp:listitem runat="server" value="5" Selected='<%# Eval("itemqty")==5 %>' />
<asp:DropDownList>
====================================================================
Error: Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.ListItem does not have a DataBinding event.
Any ideas?
For referenc, my initial C# question was on 11/5/2009.
Used C# to update the selected value while looping thru the dataset and the datalist.
modified on Thursday, November 12, 2009 3:29 PM
|
|
|
|
|
hi
I'm trying to put this aspx page in my host and run it, I've coded it using VS2010, so version of .netFrameWork is 4. But appearntly the server is running on .netFramework 3.5. so I get this error when I try to locate the page in browser:
Line 25: system.web;
Line 26: compilation debug="true" targetFrameworkMoniker=".NETFramework,Version=v4.0";
so is there anyway I can fix this or not?
thanks
Proper Prepration Prevents Poor Performance! h
|
|
|
|
|
I'm so sorry I guess that was a really stupid question to ask, since I could just choose the version when I was creating the project.
That's what an amateur does!
sorry.
Proper Prepration Prevents Poor Performance! h
|
|
|
|
|
I am sorry, but .net is not forward compatible.
i.e. you cannot run the code developed using 4.0 in 3.5.
Now, either you contact your host to provide the .net 4.0 support OR you shift project to 3.5.
|
|
|
|
|
Hi,
How i can load my project files to an iis server (not local)?
10x
|
|
|
|
|
What do you meant by load project files to server? Are you looking for deploying an ASP.NET website?
Best wishes,
Navaneeth
|
|
|
|
|
N a v a n e e t h wrote: Are you looking for deploying an ASP.NET website?
yes 
|
|
|
|
|
|
10x,
Can you please explain me what does this line means?
As its name implies, "virtual directory", does not contain any physical file. We need to define the physical file path that it will refer. We have to browse the physical path over here.
|
|
|
|
|
Virtual (as the name suggests) is not a folder that you create(physical directory) in windows.
It is actually a mapping directory. Means it points to the original directory for files.
Once you request a page, the link will be parsed by IIS and read the actual physical file appropriately.
For instance :
Say you place a file a.html inside a folder C:\myfolder .
Now you create a virtual directory "logical" and point to C:\myfolder .
Now from browser if you call
http://localhost/logical/a.html
it will actually read a.html file from C:\myfolder.
Hope you got it.
|
|
|
|
|
|
hi friends can we send the data of grid view or datalist view through mail or can we send any othe html page through mail please help me yar and i am a beginer and required a site where i can get all information rgarding how to create a good site . Now i am working for a job portal site and give me some site's or code which i can use in my project.
Thanks.
|
|
|
|
|
chandra234 wrote: can we send the data of grid view or datalist view through mail
You can easily send it by rendering them in Table format. Read the data from data base or source, generate the message body as Html text and send it as mail.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
As I understand, you have some data in a datagrid on your page, and you want to send the grid contents via email
you should write the following code in the code behind (in the event handler for the clikc event of the submit button).
private void Button1_Click(object sender, System.EventArgs e)
{
DataSet BackDataSet = (DataSet) DataGrid1.DataSource;
string xml = BackDataSet.GetXml();
}
Once you get the xml as above, you can transform it the way you want to be put in the mail.
|
|
|
|
|
Hi,
I am trying to write an addition to a webpage which is called via an ad group, once the user submits the form it removes the pc from the group, but I am having problems getting the script to work out if the "pc" is in the group - I receive an error "Object Refrence Not Set To AN Instance Of An Object." at the line which starts
Dim bInIsMember As Boolean = Convert ......
can You Help ?
Cheers
Andy
Here is the code
Sub Remove_PC_from_AD_Group(ByVal Asset)
Dim vSBCAD As New DirectoryServices.DirectoryEntry("LDAP://Domain/DC=Domain,DC=COM", vADUserName, vADPassword, AuthenticationTypes.Secure)
Dim mySearcher As New DirectorySearcher(vSBCAD)
mySearcher = New DirectorySearcher(vSBCAD)
mySearcher.SearchScope = SearchScope.Subtree
mySearcher.Filter = ("cn=GP_Refresh_Web_Popup")
Dim result As DirectoryServices.SearchResult = mySearcher.FindOne
Dim vGrpObj = result.GetDirectoryEntry
Dim myComputerSearcher As New DirectorySearcher(vSBCAD)
myComputerSearcher = New DirectorySearcher(vSBCAD)
myComputerSearcher.SearchScope = SearchScope.Subtree
myComputerSearcher.Filter = ("(computername=" & Asset & ")")
Dim vcomputerobj As DirectoryServices.SearchResult = myComputerSearcher.FindOne
Dim blnIsMember As Boolean = Convert.ToBoolean(vGrpObj.Invoke("IsMember", New Object() {vcomputerobj.Path}))
If blnIsMember Then
MsgBox("Object In Group")
Else
MsgBox("Object Not In Group")
End If
|
|
|
|
|
Respected,
How we can do for fast execution the ASP.Net page.
thanks.
|
|
|
|
|
It is a broad subject to answer in few sentences. Look at the performance optimization[^] search results. There are number of techniques to develop high performance asp.net applications
|
|
|
|
|
lrsalunkhe wrote: How we can do for fast execution the ASP.Net page.
You can take this link as one of the best
Improving ASP.NET Performance[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi there
i have asp.net 2.0. i want cool css for my grid view
from whre i get it ??
any help really appriciate ?
thans in advnace
koolprasad2003
Rating always..... WELCOME
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Just googled for it. You need to simply use color and images
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hello sir
please help me
actually i want my crystal report record should be display in following manner.
please give me suggestion how it will possible.give any formula field or any other hint
sno roll_no student_name sno roll_no student_name
1 001 A 4 004 D
2 002 B 5 005 E
3 003 C 6 006 F
if there are 6 record then it's fine and if there is 14 then 7-7 on single page.
purpose is only page saving
|
|
|
|
|
Do the logic in PageBreak. I think there is an option to define formula on page break attribute.
|
|
|
|
|
Good Afternoon,
I know it is possible to host a site from your flash using apache.
Is it possible doing the same with ASP.NET?
Thanks in advance,
Chris
|
|
|
|
|
Means you want to host your flash application in IIS ?
This is very easy. Generate an html and place the flash object there. It will start running after you publish it to IIS.
|
|
|
|