|
Hi,
Try doing it in RowDataBound event.
I guess you will be able to do it there successfully.
|
|
|
|
|
Hello Everybody
I have 4 radio button on my page and their Group Name grpSelection.
'On button click' How do I know which radio button is seleted?
Thanks
Sarfaraj
Sarfarj Ahmed
|
|
|
|
|
string name="";
if(rad1.checked)
{
name = "I selected";
}
else if(rad2.checked)
{
name = "II selected";
}
else if(rad3.checked)
{
name = "III selected ";
}
else
{
name ="IV selected" ;
}
but this code use when no of radiobutton i9s less otherwise use radiobuttonlist .
|
|
|
|
|
Hi,
What is wrong with the following code?
<ul>
<% foreach (TaskList.Task task in ViewData.Model) %>
<li>
<%= task.EntryDate.ToShortDateString() %>
</li>
</ul>
It compiles fine, but when I run it then the following error displays:
foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public definition for 'GetEnumerator'
Regards,
Brendan
|
|
|
|
|
Is ViewData.Model a collection of TaskList.Task objects?
var question = (_2b || !(_2b));
|
|
|
|
|
Cheat and use the asp:Repeater for lists like this it looks more ASP.NETy. As for the runtime error that is mostly caused by enumerating on a type without an enumerator. Remember, unfortunately, declarative programming turns compile time errors into run time errors.
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
Hi,
When I click on the show all files button to see my code behind then it shows the bin and debug folder, but not my code behind for the aspx files. Does anybody know why this happens, or am I doing something wrong?
Thanks
Brendan
|
|
|
|
|
When I create a new MVC view page this what the top of the page lookslike:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
There is no code behind attribute. What am I doing wrong?
|
|
|
|
|
on ASP.NET MVC the Code Behind class was replaced by Controller class, each view has a Controller
|
|
|
|
|
I want to replace a specified subString is a string by javascript.
I don't know the exact substring part, just I know it starts with <layer>
Best wishes
|
|
|
|
|
The string object in JavaScript has a replace method, so if you need to do more than a simple replace then we'd need some details.
From http://www.w3schools.com/jsref/jsref_replace.asp[^]:
Syntax
stringObject.replace(findstring,newstring)
Parameter Description
findstring Required. Specifies a string value to find. To perform a global search add a 'g' flag to this parameter and to perform a case-insensitive search add an 'i' flag
newstring Required. Specifies the string to replace the found value from findstring
If you need to simulate the .startsWith function in JavaScript then here's an article that demonstrates how to do so using regular expressions:
http://www.tek-tips.com/faqs.cfm?fid=6620[^]
If you need to do something different then let us know.
Regards,
|
|
|
|
|
Hi, In my project I want to bind the datetime with link button in the Repeater. I print the datetime in the Repeater using Convert(varchar,cre_date,107).It It is displaying in the format of Feb 23,2009 . But it is conflicting with the Html coding of
<asp:linkbutton id="lnldat" text="<%# Eval(" cre_date=")%>" runat="server" xmlns:asp="#unknown"> .
How to display the date in that format with Link button? Can anyone help?
modified on Monday, February 23, 2009 6:29 AM
|
|
|
|
|
Use the repeater's onitemdatabound event.
Add the OnItemDataBound="Repeater_ItemDataBound" to the mark up of the repeater.
Add the following to your code behind with modifications...
protected void Repeater_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem)
{
LinkButton lnldat = (LinkButton)e.Item.FindControl("lnldat");
DataRowView dataRow = (DataRowView)e.Item.DataItem;
lnldat.Text = dataRow["YouColumn"].toString();
}
}
I didn't get any requirements for the signature
|
|
|
|
|
An error occured like this?
Unable to cast object of type 'System.Data.Common.DbDataRecord' to type 'System.Data.DataRowView'.
What is datarowview?
|
|
|
|
|
I wrote the coding like this.
protected void Repeater_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem)
{
LinkButton lnldat = (LinkButton)e.Item.FindControl("lnldat");
DataRowView dataRow = (DataRowView)e.Item.DataItem;
lnldat.Text = dataRow["cre_date"].ToString();
}
}
And i got the error
Unable to cast object of type 'System.Data.Common.DbDataRecord' to type 'System.Data.DataRowView'.
when the form is load?
|
|
|
|
|
My fault. If you use a datatable the object is datarowview. If you use a datareader the object is dbdatarecord. just replace datarowview with dbdatarecord.
protected void Repeater_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem)
{
LinkButton lnldat = (LinkButton)e.Item.FindControl("lnldat");
dbdatarecord dataRow = (dbdatarecord)e.Item.DataItem;
lnldat.Text = dataRow["cre_date"].ToString();
}
}
I didn't get any requirements for the signature
|
|
|
|
|
It has the following error..
The type or namespace name 'dbdatarecord' could not be found (are you missing a using directive or an assembly reference?)
|
|
|
|
|
System.Data.Common.DbDataRecord
I didn't get any requirements for the signature
|
|
|
|
|
The following error came?
The type or namespace name 'dbdatarecord' could not be found (are you missing a using directive or an assembly reference?)
Where to add this line? Please explain briefly?
|
|
|
|
|
replace dbdatarecord with System.Data.Common.DbDataRecord
I didn't get any requirements for the signature
|
|
|
|
|
Can some body tell me how to implement one to one chat in Asp.net application like gmail. I simply can not figure out any solution. I tried to google this but everything I am getting is group chat like chat room. I need one to one chat. Like when you login to the application it will show the list of users online. Click on one user to chat with him/her only. Any kind of help will be appreciated.
Plz plz plz help me....
Sagar Pattnayak
Software Developer
Sun-Dew Solutions
+91-9831169962
|
|
|
|
|
Hi all, I have the same question here. I am trying to build a chat application for my webpage. What i need to do have is implement private chat. So far i have done the chat application using a database and using a timer which checks every 3-5 secs to refresh the messages.
My question is :
I need to eliminate the use of timer and want to implement it as a condition. i.e only if the user enters a chat into the box should the other person refresh his text box and it shouldnt be run on a timer. Is it possible? Please help.
|
|
|
|
|
Hi
How can I implement weather API of http://www.accuweather.com
in website.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
trilokharry wrote: How can I implement weather API of http://www.accuweather.com
With code?
I didn't get any requirements for the signature
|
|
|
|
|
Hi my gridview in inside the update panel..
then also my events are getting postback , whas the probs? y update panel is not working for me?
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|