|
Sherin Iranimose wrote: drp.Attributes.Add("OnChange", "javascript:selchange('" + drp.ClientID + "');");
drp.Attributes.Add("OnChange", "javascript:selchange(this);"); is enough.
Sherin Iranimose wrote: function selchange(combo)
{
if(document.getElementById(combo).value=="MyVal")
No need of getting element again. use combo.value instead
|
|
|
|
|
Thank You....
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
In code behind i have created image button control and placed in placeholder dynamically. can anyone help me how to add image button click event
code is as follows
ImageButton img;
for (int i = 1; i < 11; i++)
{
img = new ImageButton();
img.ID = "img" +i.ToString();
img.ImageUrl="pg/1212/"+ i +".jpg";
()";
pl.Controls.Add(img); (pl is place holder control id)
what is the code to add image control click event ?
plz let me know if u know the ans.
Thanks in advance.
Haritha
Haritha
|
|
|
|
|
Hi
try this
img.Click += new System.EventHandler(this.MyClick);
MyClick is user defined function.
protected void MyClick(object sender, EventArgs e)
{
//Your code will go here....
}
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
Hi,
Create a method with 2 arugments.
protected void img_Click ( object sender, ImageClickEventArgs e )
{
ImageButton img = ( ImageButton )sender;
Response.Write(img.ID + " ");
}
The above method will work as a handler for the click event of your dynamically generated imagebuttons.
To assign this event handler to the event of imagebuttons modify your for loop as following.
for (int i = 1; i < 11; i++)
{
img = new ImageButton();
img.ID = "img" +i.ToString();
img.ImageUrl="pg/1212/"+ i +".jpg";
img.Click += new ImageClickEventHandler( img_Click );
pl.Controls.Add(img); (pl is place holder control id)
}
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Helloo all;
I added master page(MasterPage.master) ..and I add web page(default.aspx ) that use to that master page and I want
to use javaScript code in web page (default.aspx) to get the value for example of textbox1 in(default.aspx) in where I can write it..I have tried in Content of (default.aspx) gives error ,also
in master page header gives error ??????
tkml123
|
|
|
|
|
What Error?
Regards,
Satips.
|
|
|
|
|
Hi
You can write the javascript code iside the content tag
<asp:content>
<script>
Your code...........
</script>
</asp:content>
Please post the error.
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
in web page I have textbox..i have tried to get the value of the text box and give error in browser
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" >
function ere()
{
var z=document.getElementById("TextBox1").value;
alert(z);
}
</script>
...
tkml123
|
|
|
|
|
Hi,
What error you are getting?
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
Hi,
you can pass ClientID of text box to the function.
And use the client id inside the getElementById.
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
what is the clientID??
tkml123
|
|
|
|
|
Hi aLL...
I have displayed data in datagrid,And i need to update the database with same data. i have same table(column names) in database. if any one have idea plz help me.
Suresh.R
|
|
|
|
|
Read the datagrid and store it in Arraylist and make a property of Arraylist and then update the Database.
Hope it helps u...
|
|
|
|
|
I am encountering the following error while sending an outlook meeting request.
Exception Details: System.UnauthorizedAccessException: Access is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true">, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
I assigned all the permissions possible but it ain`t work.
Following is my code:
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Outlook;
public static void CreateMeetingRequest(string toEmail, string subject, string body, DateTime startDate , DateTime endDate)
{
Outlook.Application objOL = new Outlook.Application();
Outlook.AppointmentItem objAppt = (Outlook.AppointmentItem)objOL.CreateItem(OlItemType.olAppointmentItem);
objAppt.Start = startDate;
objAppt.End = endDate;
objAppt.Subject = subject;
objAppt.Body = body;
objAppt.MeetingStatus =Outlook.OlMeetingStatus.olMeeting;
objAppt.RequiredAttendees = toEmail;
objAppt.Send();
objAppt = null;
objOL = null;
}
private void Button1_Click(object sender, System.EventArgs e)
{
CreateMeetingRequest("abc.23@gmail.com","Hello test","Cool it works",DateTime.Now.AddDays(1),DateTime.Now.AddDays(1).AddHours(1));
}
Pls help!!!!
|
|
|
|
|
Hi all. I am in situation like .i have uploaded an Excel file and i have displayed in a grid but i am unable to store it into database.
can u plz help me out
Suresh.R
|
|
|
|
|
You're going to store it as a BLOB, because it's a bunch of binary data, not a data type that your database knows about.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
I'm new in asp.net, Now i'm developing a project for a news agency. I stored fields about news like NewsTitle, NewsBrief,NewsDate,... in database. I want to show custom news (for example last 10) in a home page. Which control i should use? Each news containg title, breif, small picture and the news.
Should i use panel control or i should add table programmatically to the page?
Please Help, Tanx.
|
|
|
|
|
I'd use a repeater, to give me full control over how each item is rendered, and make it's data source a collection of NewsItem objects (a class you create )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Dear Christian
Sorry! Your answer is not completely usefull. Can you give me a source? Is repeater a control or its Custum control you created for yourself? How youu add that to your page?
Tanx
|
|
|
|
|
HI Reapeter is ASP.NET 2.o server control you can add it by simply drag and drop from control panel to your page ...
If you want some code please search on google for it definalty you will get many sites best of luck
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
The Repeater Web server control is a container control that allows you to create custom lists out of any data that is available to the page. The Repeater control does not have a built-in rendering of its own, which means that you must provide the layout for the Repeater control by creating templates. When the page runs, the Repeater control loops through the records in the data source and renders an item for each record.
Repeater Web Server Control[^]
Regards,
Satips.
|
|
|
|
|
Ok friends
Tanx for all your replies. You solved my problem. It's cool. I found many references in web about Repeater Control.
Regards
|
|
|
|
|
Hello,
I've a small question about designing my own component.
Well, I need to create a component, whose look like this:
http://www.danflash.com/files/dev/pm-tree.jpg
All items and subitems should be drag an dropable (with AJAX support) and should have an undefiend amount of levels...
Each item/subitem needs also a small icon on the lefthand-side of the text and an other icon (in this case a red flag) on the righthand-side.
How can I build such an object? The standard components from VS2005 aren't flexable enough and the whole component package from DevExpress, which I own, haven't any treelists or treeviews.
May, is a grid a good thing to start? Or which component (opensource or commercial) could you recommend?
Thank you,
sincerly
Danny Meier
|
|
|
|
|
Easy question most likely, but I don't know where to get started.
I need to build an HTML form dynamically based on the results of an SQL query I am doing so I can submit the form to paypal.
They need something in this format (this is from their example site):
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><br />
<input type="hidden" name="cmd" value="_cart"><br />
<input type="hidden" name="upload" value="1"><br />
<input type="hidden" name="business"<br />
value="seller@designerfotos.com"><br />
<input type="hidden" name="item_name_1"<br />
value="Item Name 1"><br />
<input type="hidden" name="amount_1" value="1.00"><br />
<input type="hidden" name="item_name_2"<br />
value="Item Name 2"><br />
<input type="hidden" name="amount_2" value="2.00"><br />
<input type="submit" value="PayPal"><br />
</form>
So I need to be able to insert that HTML onto my ASP page and then recursively add sections like this for each item returned from my SQL query.
<br />
<input type="hidden" name="item_name_1"<br />
value="Item Name 1"><br />
<input type="hidden" name="amount_1" value="1.00">
Alternately, if anyone knows of an easier way to submit a shopping cart to paypal from an ASP page I'd love to hear it.
Thanks
|
|
|
|