|
hi friends
can anyone help me with this issue plz:
i am creating dynamic radio buttons based on the values i choose from a dropdownlist and if i click the save button i am not able to get the radiobuttons clicked ids so how to do it.....
looking for help....
K.Gayathri
|
|
|
|
|
i am using the following code
RadioButton rdl ;
rdl = (RadioButton)PHEmailfmt.FindControl("rd1") as RadioButton;
if (rdl != null)
{
if (rdl.Checked)
{
Response.Write("rd1 is checked");
}
}
rdl = (RadioButton)PHEmailfmt.FindControl("rd2") as RadioButton;
if (rdl != null)
{
if (rdl.Checked)
{
Response.Write("rd2 is checked");
}
}
rdl = (RadioButton)PHEmailfmt.FindControl("rd3") as RadioButton;
if (rdl != null)
{
if (rdl.Checked)
{
Response.Write("rd3 is checked");
}
}
}
but the find control returns null so can anyone help me plz...
i have created 3 dynamic radio buttons as rd1,rd2,rd3
and on the click of the save button i have the following..
K.Gayathri
|
|
|
|
|
at first, i don't know why you don't use an
<asp:RadioButtonList> it will give you what you want exactly with less effort
if it is:
it would be like that:
<asp:RadioButtonList ID="_radioButtonList" runat="server">
<asp:ListItem Text="text1" />
<asp:ListItem Text="text2" />
</asp:RadioButtonList>
you can create items in it dynamically like this:
ListItem item = new ListItem("Text");
_radioButtonList.Items.Add(item);
and to get SelectedItem , its Text or Value just do like that:
ListItem item=_radioButtonList.SelectedItem;
string selectedItemText=_radioButtonList.SelectedItem.Text;
string selectedItemValue=_radioButtonList.SelectedValue;
you can take SelectedValue in the Save Button Click
Sincerely,
Ibrahim Hebish | SharePoint Software Developer |GlobeSoft(Comp)| EX:EgyptNetwork(Comp)
M: +201281744594
Email: Pronto.cs@gmail.com
|
|
|
|
|
Hi All,
I have a main report with selection formula
i.e if i select employee it will show all the details of employee
later i added subreport with leave information
My requirement is ..
if the user select the employee it should pass the employee name to the subreport stored procedure(c#) as parameter
Please help me with this
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
modified 14-Dec-11 6:41am.
|
|
|
|
|
have a gridview on my webpage that binds from an excel sheet using OleDb
Now I'm trying to set it up so that people can search just by typing a word in the textbox, and then after button click, it'd filter all the results that have the same word in any column
I was advised to use this code:
<pre lang="c#">
protected void Button1_Click(object sender, EventArgs e)
{
string search = TextBox1.Text;
OleDbConnection conn = new OleDbConnection(strConn);
conn.Open();
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", conn);
OleDbDataAdapter da = new OleDbDataAdapter();
da.SelectCommand = cmd;
DataTable dt = new DataTable();
da.Fill(dt);
grvCarProof.DataSource = dt.Select("CP number = ");
grvCarProof.DataBind();
}
</pre>
what I can't figure out is what kind of writing should go in my SelectCommand(). Am I even doing it right?
Any advice you can give me would be greatly appreciated. Thanks in advance.
|
|
|
|
|
Hi,
I am using just the following piece of code which assigns to an Entity Framework entity.
if (subordinateValueType.TaskTypeId > 0)
{
TaskTypeController taskTypeController = new TaskTypeController();
subordinateValueTypeEntity.TaskType = taskTypeController.GetEntity(subordinateValueType
.TaskTypeId, context, LoadType.Simple);
}
But I am getting the below exception. Can anybody please help me to get rid of the exception. Thanks in advance.
[System.InvalidOperationException] = {"A referential integrity constraint violation occurred: A primary key property that is a part of referential integrity constraint cannot be changed when the dependent object is Unchanged unless it is being set to the association's principal object
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
hi
I want to add a control like textbox when I click a button and new textbox added to the page but when i click the buttom just create one textbox and I lose previus text box
please help me what I shoud do .
|
|
|
|
|
You need to think about the sequence of events (Where and how do you create/recreate the controls) and using ViewState to preserve the control through PostBacks. Found this in under 30 seconds: ow to add and persist controls dynamically[^].
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
mark merrens wrote: Found this in under 30 seconds:
isn't google awesome??
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
Dear all,
I have the following configuration for my sessionState:
<sessionState mode="InProc" cookieless="UseCookies" timeout="10" >>
It works fine, but there is one thing i don't understand.
When i open multiple tabs, all tabs have the same SessionID, but they don't time out at same time.
I thought that all tabs share the same session, so they have to have also the same timeout
What i want is that ofter session timeout occurs, to logout the user from all opened tabs at the same time.
But in my situaion, when two tabs are open, the first one logs the user out, but not from the second tab. On the second tab, the user still can work.
This is my code to logout and redirect the user ofter session timeout:
protected void Session_Start(object sender, EventArgs e)
{
if (Context.Session != null)
{
if (Context.Session.IsNewSession)
{
string sCookieHeader = Request.Headers["Cookie"];
if ((null != sCookieHeader) && (sCookieHeader.IndexOf("ASP.NET_SessionId") >= 0))
{
FormsAuthentication.SignOut();
HttpContextBase httpContext = new HttpContextWrapper(HttpContext.Current);
UrlHelper urlHelper = new UrlHelper(new RequestContext(httpContext, new RouteData()));
string redirectUrl = urlHelper.Action("LogOn", "Account");
httpContext.Response.Redirect(redirectUrl);
}
}
}
}
How can i solve this issue?
Thanks in advance.
|
|
|
|
|
Does this help?[^]
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
I want to upload image and immediate open it without database connection in asp.net c# programme?
|
|
|
|
|
|
hi
when click on edit button,I allow to update 2 columns.I want cell text of these colums should be null means user insert a new value.
how it is possible?
I used on editing event
protected void jgjgj(object sender, GridViewEditEventArgs e)
{
int index = e.NewEditIndex;
GridViewRow row=GridView4.Rows[index];
row.Cells[4].Text = "";
row.Cells[5].Text = "";
this.Modalpopupextender1.Show();
}
but it is not working.
|
|
|
|
|
Once you assign new edit index, you have to bind the grid again. then later access the controls and assign the values to that. check this..
GridView4.EditIndex = e.NewEditIndex;
GridView4.Datasource = yourDataSource;
GridView4.DataBind();
GridViewRow row = GridView4.Rows[4];
TextBox txt = (TextBox)(row.FindControl("TextBoxID"));
txt.Text="";
txt = (TextBox)(row.FindControl("TextBoxID2"));
txt.Text="";
with regards
Karthik Harve
|
|
|
|
|
I do not have textbox control.where to find TextBoxID?
|
|
|
|
|
Try to this one:
GridView4.EditIndex = e.NewEditIndex;
string str = GridView4.DataKeys[e.NewEditIndex].Value.ToString();
GridViewRow row = (GridViewRow)grvCompType.Rows[e.NewEditIndex];
row.Cells[1].Text = "";
|
|
|
|
|
this is same as my efforts.see question again.
|
|
|
|
|
I'm Developing an Application. In that I have using a Flash file uploader (Asynch) for changing User Images. But after uploading The Image is taken from cache I have tried so many things to resolve this issue like
<%@ OutputCache Duration="5" VaryByParam="None" %>
then
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now);
But Still couldn't resolve this issue
|
|
|
|
|
Hello All,
I am very new to this avenue of ASP.NET. Yet, I am focussing on building a discussion forum(web based) using ASP.NET. I am told that there are ready made wiki templates which can be used to achieve this.
I searched on the net and did find some templates but don't know how can I use them and embedd those in my .aspx pages. Can someone provide me a link or a two which I can study and implement the scenario?
Thanks in advance...
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
I was expermenting with Area's, and even after following the various guides and registering the routes using the Namespace parameter, I'm still get the Naming Conflict on the HomeController.
The request for
ANSLWebToolkit.ANSLWebToolkit.Areas.Operations.HomeController
ANSLWebToolkit.ANSLWebToolkit.Controllers.HomeController
So, I created a new MVC project in VS2010. I then created a new Area called "Operations", then added a new "Home" controller under this new area.
According to all the docs, having controllers in each area (or the root) with the same name is perfectly acceptable, providing you register the routes using the Namespace parameter. So the clash I'm getting is on the default HomeController (original non-area) and the Operations area HomeController.
I have checked the controller and the route registration sections, and all appears to be fine;
The global.asax file;
Public Class MvcApplication
Inherits System.Web.HttpApplication
Shared Sub RegisterGlobalFilters(ByVal filters As GlobalFilterCollection)
filters.Add(New HandleErrorAttribute())
End Sub
Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
New With {.controller = "Home", .action = "Index", .id = UrlParameter.Optional},
New String() {"ANSLWebToolkit.Controllers"}
)
End Sub
Sub Application_Start()
RegisterGlobalFilters(GlobalFilters.Filters)
RegisterRoutes(RouteTable.Routes)
AreaRegistration.RegisterAllAreas()
Debug.WriteLine("Registered Route Table: ")
For Each item As Route In RouteTable.Routes
Debug.WriteLine(item.Url)
Next
End Sub
End Class
The default HomeController;
Namespace ANSLWebToolkit.Controllers
Public Class HomeController
Inherits System.Web.Mvc.Controller
Function Index() As ActionResult
ViewData("Message") = "Welcome to ASP.NET MVC!"
Return View()
End Function
Function About() As ActionResult
Return View()
End Function
End Class
End Namespace
The OperationsAreaRegistration class
Namespace ANSLWebToolkit.Areas.Operations
Public Class OperationsAreaRegistration
Inherits AreaRegistration
Public Overrides ReadOnly Property AreaName() As String
Get
Return "Operations"
End Get
End Property
Public Overrides Sub RegisterArea(ByVal context As System.Web.Mvc.AreaRegistrationContext)
context.MapRoute(
"Operations_default",
"Operations/{controller}/{action}/{id}",
New With {.action = "Index", .id = UrlParameter.Optional},
New String() {"ANSLWebToolkit.Areas.Operations"}
)
End Sub
End Class
End Namespace
Anybody see what is wrong or how can I work out why even when using the namespace parameter, it still clashes. As you can see I put some debug to dump the route registration table and it is doing what it should;
Registered Route Table:
{resource}.axd/{*pathInfo}
{controller}/{action}/{id}
Operations/{controller}/{action}/{id}
Any help appreciated, I'm going loopy with this basic error!
|
|
|
|
|
A "friend" of yours downvoted this, so I've compensated to put visibility back to a reasonable level.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
A new Schema importer extension was created to return a Forum object instead of Book object when invoking Select method of a web service.When running a asp.net web page that invokes the Select method of the web service(which returns Book object) the WriteXml method of Book class(original type returned by web service method) is invoked and the object Serializes itself there and then ReadXml method of Forum class(new type registered by schema importer) is invoked but the XmlReader parameter does not contain actual data :
void IXmlSerializable.ReadXml(XmlReader reader)
{
this.title = reader.GetAttribute("title") + " by " + reader.GetAttribute("author");
this.bookID = reader.GetAttribute("bookID");
}
reader.GetAttribute("title") and reader.GetAttribute("author") return null and finally the Forum object returned from Select method of the web service contains empty fields ?
Am I missing something in implementing this Schema importer extension?
|
|
|
|
|
Hi,
How to upload all the files from a folder in a button click.
eg: there is a folder in the client system with some files, from a button click i need to upload all the files from that folder.
is it possible in asp.net or javascript.
or will it possible if the folder is in the server where the files are published.
Thankyou,
YPKI
|
|
|
|
|
Because of security issue we don't have any control on accessing files/folders on client system.
|
|
|
|