|
I'm explaining u in easiest way ....
when we are clicking a button textbox should be visible.........
when we are clicking again the same button textbox should invisible
Both these controls are placed in datalist......
so that multiple buttons & textboxes are coming I am not able to differentiate the click events
when i'm clicking one button all textboxes disappearing.... and if i click again all textboxes appearing .......
one button should work for one text box ()..........
Help me I think you understood the question........
waiting for ur reply.
|
|
|
|
|
OK now I got the idea. and I'm gonna try and give u a few guidelines and I Hope it works for u
1st you need to use Javascript. use the getElementById() function in orderto get the column of the textbox u wanna show/hide.
In the button you should make an onclick method and change its text to 'show' when its clicked with text 'Hide' and vice versa
On the basis of this text you can toggle the show/hide functionality in Javascript.
I hope u get it done now..
best of luck
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Hi
How to generate a pdf file from a byte array.
I have data in byte array. I want to open a pdf file in new window with Save option.
Any one help on this...
|
|
|
|
|
Open a new window (using Javascript or target="_blank") and request a page for it. Make the page return the byte array as response by using Response.BinaryWrite.
---
single minded; short sighted; long gone;
|
|
|
|
|
i have a dropdownlist in web control.i wanted to retrieve the dropdownlist selectedindex , and for that i want to use the get and set properties .
i am writing the following code.
int index;
public int DropDownListSelecttedIndex
{
get
{
return DropDownList1.SelectedIndex;
}
set
{
index = value;
}
}
the above code is write?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote: the above code is write?
Syntactically it's correct, but logically wrong. You are not assigning the variable index back to Dropdown list.
|
|
|
|
|
public int DropDownListSelecttedIndex
{
get
{
return DropDownList1.SelectedIndex;
}
set
{
index = value;
DropDownList1.selectedindex = value;
}
}
If it would be like that ?Then was it right?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Yes. But still why you are assigning value to variable index if you are not using it ?
|
|
|
|
|
public int DropDownListSelecttedIndex
{
get
{
return DropDownList1.SelectedIndex;
}
set
{
DropDownListSelecttedIndex = value;
}
}
Is it right now?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
I want to add child nodes in tree veiw
how can i do it.
foreach (DataRow row in tbs.Rows)
{
treeVu1.Nodes.Add(row["TABLE_NAME"].ToString());
foreach (DataRow row1 in clmns.Rows)
{
TreeNode tnode = new TreeNode("COLUMN_NAME");
//here i want to add columns names as child
}
}
regards,
chanzeb chaudhary
|
|
|
|
|
you need to get the particular TreeNode object to which you wanna add the child to and then use the Add function like that. how to get that Node programatically is up to u.
Hope that helps
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
hi friends,
i did lot of R&D on this but finally i was stopped here ........and i am unable to do this ...please provide the solution for this ..
i am passing the parameters from webapplication(asp.net to c#)
i wrote the code in asp.net is like this
System.Diagnostics.ProcessStartInfo startInfo;
Process p = new Process();
p.StartInfo.Arguments = "new" ;///this line is for passing the parameters to that exe)
startInfo = new System.Diagnostics.ProcessStartInfo(@"Mainform.exe");
how can cal the above parameter ("new") in the exe(c#)
Ramesh
|
|
|
|
|
Hello,
I dont' know if I understand your question.
But if you want to know where you get your argument in your C# project.
It is the Main Entry Point
public static void Main(string [] Args)
{
if (Args.Length > 0)
{
string value1 = Args[0];
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
The following code is being executed in a highly threaded environment.
1. Why does the Debug.Assert statement sometimes fail?
2. What can be done to stop this from occurring?
public class Warehouse
{
private int stockCount = 0;
public void DecrementStock ()
{
if ( stockCount > 0 )
stockCount--;
Debug.Assert ( stockCount >= 0 )
}
public void IncrementStock()
{
stockCount ++;
}
}
|
|
|
|
|
If you're running this code in a threaded environment you are running into problems because it's not thread safe. The Debug.Assert call itself isn't threadsafe and neither are the DecrementStock and IncrementStock methods. The most likely explanation is that you have multiple threads manipulating the stockCount variable at the same time which is giving unpredictable behavior.
There are a lot of different ways to protect against this, from using the lock keyword to using InterlockExchangeCompare . The easiest is probably the lock syntax, which would look something like this:
public class Warehouse
{
private object syncRoot = new object();
private int stockCount = 0;
public void DecrementStock ()
{
lock(syncRoot)
{
if(stockCount > 0)
{
stockCount--;
}
Debug.Assert(stockCount >= 0);
}
}
public void IncrementStock()
{
lock(syncRoot)
{
stockCount++;
}
}
} Also, in the future, please use the <pre> tags for code blocks to preserve the formatting.
|
|
|
|
|
Friends,
Is there a way to backup database using c#? What I mean is that,
in a form, there is database name, login and password. When I click backup button, it will create backup in sql server management.
Example: CODEPR(databasename) then click backup button it will named as CODEPR_backup.
Any help or links much appreciated.
Thanks,
C#Coudou
******************************
I just want to
know everything
|
|
|
|
|
Hi,
There is a system stored procedure for database backup functionality. (I cannot remember the sp's name at the moment).
So you can execute that sp from your C# code.
Hope this helps to you.
http://msdn2.microsoft.com/en-us/library/ms188409.aspx
Regards!
jayasshc
|
|
|
|
|
Backup/Restore Programatically[^]
I think you need to add an SP with BACKUP functionality and execute that
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
|
Do you have a question? What was the point of your post?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
There's a link in my thread, read it at it's location and answer here if you can. Thanks.
|
|
|
|
|
Example:
....<br />
Thread a = new Thread(method1);<br />
a.Start();<br />
....<br />
....<br />
void method1() {<br />
textBox1.Text = "Hello";<br />
}
if i execute that code, they give me an InvalidOperationException error (access to textbox1 from another process)
i try to call that method using an delegate, but not works
another way is add this code:
CheckForIllegalCrossThreadCalls = false;
but i don't need to deactivated that
how i can fixed?
|
|
|
|
|
you can access a Control only from the thread that created it, normally the main thread.
Read up on Control.InvokeRequired and Control.Invoke()
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
need some tutorial or example please (to understand)
|
|
|
|
|
MSDN, Google and CodeProject are full of examples: almost every app that uses extra threads
needs it!
Here is an example in VB.NET[^], the last code snippet shows the principle.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|