|
Hi.
I have a userControl with this method : (tbl1 is an ASP.Net Table Control)
Public Sub MyInit()
Dim txt As New TextBox()
Dim tc As New TableCell()
tc.Controls.Add(txt)
Dim tr As New TableRow()
tr.Controls.Add(tc)
tbl1.Controls.Add(tr)
End Sub
and there is a button on this userControl that I've written this Code in Click event:
Dim i As Integer = tbl1.Rows.Count
Now, In a web form that has a button, I dropped this usercontrol, and in Click event I've written :
userControl1.MyInit()
And Now by clicking the button of web page, a row with a TextBox inside, will add to page,
but after clicking the button in usercontrol, tbl1.Rows.Count is 0.
I want to read the Text of TextBox, but at all the tbl1 is clear!
I've to creat controls dynamically as above (MyInit()), how can I solve it?
Best wishes
|
|
|
|
|
hi everyone
I created an application in that i can send mails to gmail but
iam unable get code for how to recieve mails which i will send from gmail or yahoo..
to my application..
Is it possible to receive mails to application which is running on my local machine
Please help me
thanks in advance...
|
|
|
|
|
I am not sure about Yahoo, But google provides some API to aceess mails. You can explore them .
|
|
|
|
|
|
Hi,
I am having datagrid in which data is coming.Suppose we have three rows in the datagrid.Each row is having a checkbox.In each row we have five columns. One of them is "QTY" which is having a textbox as a templte column.Below the grid we have a "update" button.Suppose in the original state quantity is "1".And the user changes it to "4" and presses the update button.Then the row should be modified having quantity "4".
What I have done is:
protected void BtnUpdate_Click(object sender, EventArgs e)
{
dt = (DataTable)Session["Cart"];
CheckBox chkSelected = new CheckBox();
foreach (DataGridItem dgItem in DataGrid2.Items)
{
chkSelected = (CheckBox)dgItem.FindControl("chkSelection");
if (chkSelected.Checked == true)
{
TextBox TxtQTY = (TextBox)dgItem.Cells[2].FindControl("TxtQTY");
int Txt2 = Convert.ToInt32(TxtQTY.Text);
Label lblProduct_Id = (Label)dgItem.Cells[0].FindControl("lblProduct_Id");
string id2 = lblProduct_Id.Text;
Label lblDescription = (Label)dgItem.Cells[1].FindControl("lblDescription");
string desc2 = lblDescription.Text;
Label lblPrice = (Label)dgItem.Cells[3].FindControl("lblPrice");
float price2 = Convert.ToSingle(lblPrice.Text);
Label lblCost = (Label)dgItem.Cells[3].FindControl("lblCost");
float cost2 = Convert.ToSingle(lblCost.Text);
float final_cost = price2 * Txt2;
DataRow myrow = dt.NewRow();
myrow["REF"] = id2;
myrow["Description"] = desc2;
myrow["QTY"] = Txt2;
myrow["Price"] = price2;
myrow["Cost"] = final_cost;
dt.Rows.Add(myrow);
dt.AcceptChanges();
Session["data"] = dt;
}
}
DataGrid2.DataSource = dt;
DataGrid2.DataBind();
}
But when I am pressing the update button it is updating the row but it is also showing the previous row.
I am trying to get the index of the row which is checked by the user to update.And then I will delete that row.
But I am unable to do this.
Help me out ...
Thanx in advance.
cheers,
sneha
|
|
|
|
|
Dear,
First, this is the wrong board, DataGrid is desktop control, why you asking about it in ASP.NET board.
Second, I see that you send the same question about 10 times, and somebody sent you answers on the C# board
Third, I think you have to make use of MSDN, or read some books first
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Mohammed Gouda wrote: DataGrid is desktop control
Click[^]
|
|
|
|
|
Hi Sneha ,
Instead of writing the following code:
foreach (DataGridItem dgItem in DataGrid2.Items)
{
chkSelected = (CheckBox)dgItem.FindControl("chkSelection");
if (chkSelected.Checked == true)
{
Write the code written below:
foreach (GridViewRow gr in DataGrid2.Rows)
{
if (((CheckBox)gr.FindControl("chkSelection")).Checked == true)
{
-----Have A Nice Day-----
|
|
|
|
|
Hi,
When it is said to wrap a control with something else. what does it mean?
Best wishes
|
|
|
|
|
Wrapper means a control is used as a component of another control, so that it can behave the same way but have extra functions within it.
Abhishek Sur
|
|
|
|
|
if (file.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
}
I am using the above code to download files listed in a listbox control
I am placing the listbox in WebPartZone to enable the client to change the page layout, also I put it in an AJAX UpdatePanel to disable postbacks
When I use ONLY the UpdatePanel, it works well
When I use ONLY the WebPartZone, it works well
When I use both together, I get an exception saying:
Sys.WebForms.PageRequestManagerParseErrorException: The message received from the server could not be parsed.Common causes for this error are when the response modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'MZ'.
foreach(Minute m in MyLife)
myExperience++;
modified on Thursday, January 22, 2009 2:49 AM
|
|
|
|
|
|
Hi friends i need coding . i have to send invitation to join the website for my site .suppose in gmail or yahoo there is option for invitation .there is option when we fill the mail id it automatically send the link to the reciever
modified on Thursday, January 22, 2009 2:13 AM
|
|
|
|
|
You just need to send mails buddy... that is not a big deal. If you dont have your smtp server, use gmail either.
Gmail gives support to send mails.
Abhishek Sur
|
|
|
|
|
.... and while send mail , you can send a link with user name and other information to validate that user. When user click on that link, simple redirect to particular page and validate the query string , that user is valid or not.
|
|
|
|
|
sir
i am student of MSC-IT.
i do project in NIC.
i want to store exel sheet into SQL database.
so sir help me
how can i convert exel data into SQL database.
send me ans as early as possible.
thank you.
|
|
|
|
|
u can search this issue from google.com
see these links: "http://www.biztalkgurus.com/forums/t/5813.aspx
"http://www.dotnetspider.com/forum/149880-Insert-Excel-Sql-Database-for-asp-net.aspx
hope it helps
|
|
|
|
|
What you need, do you need the excel data only, or the excel file totally,
If you need the data, you can open an OleDb connection with
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=filePath;Extended Properties="Excel 8.0;HDR=YES;IMEX=1";
Then you can select from Sheets
using Select * from [Sheet1$]
Hope this helps. If you still have problems, I can help you with codes too...
Abhishek Sur
|
|
|
|
|
|
My problem is file uploading is failed when website is published otherwise its working fine
I am using IIS 5.0 and ASP.net 3.5 in Visual Studio 2008
For attatching file i am using a seperate popup window and saveing posted file in session variable
Session["postedFile"] = uploadFile.PostedFile; // HttpPostedFile from FileUpload control
Uploading is done from another page.
Is it can be done in better way?
Please help
Regards
Radhakrishnan G.
|
|
|
|
|
Why do you use Session to store files.... It is the highest possiblity of the user to upload a large file and eat up all the memory of the server..
Think it will be better to write in disk rather than using memory for file upload.
Abhishek Sur
|
|
|
|
|
Thanks for the reply.
Yes thats good idea.
I shall keep these attatched files in the Temperory folder of the server
after the processing and uploading I will remove this files..
|
|
|
|
|
Hi,
I have to call a Java Web Service from a .Net Client .I'm using VS2008 (.net 3.5).
Web service was developed with Java. It is installed on a Tomcat server.
The web service offers some methods. A group of methods returns a xml file and a xml attachment.
A group of methods accepts a xml file and a file attachment.
How can I manage this situation ?
I saw different articles and documentation pages.
What's the best strategy ?
I read something about create a VS2005 project with WSE 3.0 and import it in VS2008.
I found notes about WCF ( I don't know WCF . It's the right tool ? ).
I tried a solution like this :
http://blogs.msdn.com/bursteg/archive/2008/07/19/how-to-call-a-java-ee-web-service-from-a-net-client.aspx
I tested article's code. It seems that is no way to manage attachment ...
When I invoked a method I saw this error . "The content type application/dime of the response
message does not match the content type of the binding (text/xml; charset=utf-8).
If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.".
My custom code ( more or less)
WebApp.MyReference.WSMethodClient myMethod = newWebApp.MyReference.WSMethodClient();
// return a xml string and a attachment to soap message. I get xml string , but how can get attachment ?
string l_var = myMethod.service( p_CodApplication, p_UserName, p_Password );
How can I manage the attachment ? How can I manage soap messages with VS2008 ?
Could you help me ?
|
|
|
|
|
Pick one forum and stick with it. Don't cross post just because you don't receive an answer immediately.
only two letters away from being an asset
|
|
|
|
|
Ok ! I'm sorry. I wasn't sure about the right forum ...
|
|
|
|