|
jrsreenivas wrote: My reuirement is need to generate text boxes dynamically on the selection of drop down list where the drop down list
contains no and on selection of drop down list i need to create text boxes .
jrsreenivas wrote: protected void ddlAdoption_OnSelectedIndexChanged(object sender, EventArgs e)
{
lblCount.Text = ddlAdoption.SelectedValue;
int adoptionCount = Convert.ToInt32(lblCount.Text);
for (int i = 0; i < adoptionCount; i++)
{
TextBox txtAdoptionNo = new TextBox();
This is not the way how ASP.NET Works. Just back to the APS.NET Page life cycle, All Postback Data and ViewState Data Loads Just Before Page_Load() Event. Now If you are creating Textbox in Dropdown list selected index changed, the Textbox will be created, but it will not able to load the Postback and View State Data. So this will not help you at all. You have to create the textbox on Pre_Init() Event, so that It can load the ViewState and Postback data.
|
|
|
|
|
hi Abijit,
thanks for your response can you please let me know the code how to write pre_init() so that it works for me .
thanks in advance
sreenivas
|
|
|
|
|
jrsreenivas wrote: can you please let me know the code how to write pre_init()
Hi Try this,
protected void Page_PreInit(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
string s = Request.Form["DropDownList1"];
}
}
Hope this will help you
|
|
|
|
|
I think creating dynamic textboxes will be easier if you use javascript. Use
var input = document.createElement('input');
input.type='text';
var container = document.getElementById('yourcontainerdiv');
container.appendChild(input);
Likewise create no of textboxes to the container div.
By this way you can omit the unnecessary server call.
|
|
|
|
|
Hi Abishek thanks for your response actually i had created similar to your code but i had to validate the values in the test box and i need to get the values to the c# page . so i had problem in that so i did this way
|
|
|
|
|
I've got to add to ASP.NET project unsafe C# code that invokes native win32 code from some DLL.
I enabled 'unsafe code' in web project build setting and it compiles normally, but when you run the site to debug with F5 it reports to the html page the error:
"C:\Windows\Microsoft.NET\Framework\v3.5
\csc.exe" /t:library /utf8output /R:"C:\Windows\assembly\GAC_32
\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35
\System.WorkflowServices.dll"
...
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.
...\App_Code\SampleUnsafe.cs(36,29): error CS0227: Unsafe code may only appear if compiling with /unsafe
Where can I change that csc.exe compilation command line?
Where to put native DLL (e.g. root virtual path?) so that unsafe cs code will be able to load it.
Чесноков
|
|
|
|
|
<compilers>
<compiler language="c#;cs;csharp" compilerOptions="/unsafe" ...
Чесноков
|
|
|
|
|
Hi all,
I've created a windows application through C# to add appointment in outlook 07 programatically. now i want to perform some action as soon as a new contact is added in the outlook i.e. i want to handling add contact event. please help me.
|
|
|
|
|
ACMA_1980 wrote: I've created a windows application through C#
And you asking this in ASP.Net forum?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
You have improved your typing speed buddy
|
|
|
|
|
ACMA_1980 wrote: I've created a windows application through C# to add appointment in outlook 07 programatically
Then why you are asking over here? This is ASP.NET Forum. Please ask in C# Forum.
|
|
|
|
|
|
hi,
any one help me,,,
When i change the textbox content, it fire the .js(Script file) and set the button visible propery as true.
.js as a separate script file.
Thanks.
|
|
|
|
|
svm_kala wrote: When i change the textbox content, it fire the .js(Script file) and set the button visible propery as true
I didn't get can you be bit detail?
Cheers!!
Brij
|
|
|
|
|
When i change the text on the "Text box" to fire the javascript code, Like,
Button id :-
<asp:button id="<b>btnSave</b>" runat="server" text="Save">
onchangetextbox event:-
<asp:textbox id="txtFirstName" runat="server" text="FirstName" <b="">onchange="onButton('btnSave')">
My .js code:-
var button;
function onButton(ButtonValue)
{
button=document.getElementById('ButtonValue');
}
the variable "button" returns the null value.
Plz any one help me... how to solve the proble.
|
|
|
|
|
<asp:TextBox ID="txtFirstName" runat="server" Text="FirstName" onchange="onButton('<%=btnSave.ClientId%>')">
|
|
|
|
|
|
Do as DoctorMick says.If any other problem let me know
Cheers!!
Brij
|
|
|
|
|
|
ravindarp wrote: any body its an urgent
Only for you and not for us.
ravindarp wrote: on perticular information(topic)[ex: tata steel] when updated in world By using .Net
What do you mean by saying information is changed in world?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
That means any updates on that perticular topic like stock news of Tata steel today or any updation news on tata steel ltd.
|
|
|
|
|
Does they provide any RSS kind of information ? You need to feed the information in timely manner and if some update then you need to send the email notification.
|
|
|
|
|
Yes, i need that kind of code in .net or any sample applications. Similar to google alert.
|
|
|
|
|
i am tying to update source table to copy in destination table.
i want old record update and new record insert in destination table.
Following code is i am tying.
new record inserted but old record not updated in data base.
when i am merge table than that value up date in datatable but
problem with database.
public void Replication(string TableName)
{
DataTable dtSource = GetAllTableData(CnSorce, TableName);
DataTable dtDest = GetAllTableData(CnDest, TableName);
dtSource.AcceptChanges();
dtDest.Merge(dtSource);
dtDest.AcceptChanges();
DataSet ds = new DataSet();
ds.Tables.Add(dtDest); InsertData(ds, CnDest);
}
public int InsertData(DataSet ds, SqlConnection cn)
{
try
{
cn.Open();
if (cn != null)
{
SqlTransaction transaction = cn.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);
foreach (DataTable dt in ds.Tables)
{
if (dt != null && dt.Rows.Count > 0)
{
cmd.Connection = cn;
cmd.Transaction = transaction;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from " + dt.TableName;
adapter.SelectCommand= cmd;
cmb.DataAdapter = adapter;
adapter.UpdateBatchSize = dt.Rows.Count;
adapter.Update(dt);
transaction.Commit();
}
else
{
transaction.Rollback();
return 0;
}
}
return 1;
}
else
return 0;
}
catch (Exception ex)
{
return 0;
}
}
|
|
|
|
|
hi all
i am using asp.net 2.0, and code to zip a file
the code works for folder size 60 MB but if the folder size is more than 60MB then it throws me following error
"Insufficient system resources exist to complete the requested service"
i used ICSharp DLL to make zipped folder
I have 256 MB RAM on my machin
what should i do ???
is anybody has occoured this type of error while using ICSharp DLL
thankx in advance
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|