|
Hello all,
I am trying to call a javascript function from a Link Button.
<asp:LinkButton OnClick = "javascript:popupwin(VrNo=<%#DataBinder.Eval(Container.DataItem,"IDD")%>,1,frmClient.HiddenClientId.value)" ID="lnkViewDetails" runat="server">View Details</asp:LinkButton>
But i am getting a follwing error while switching to design view "The server tag is not well formed"
Where is the problem ??
Please help ...
|
|
|
|
|
use the LinkButton onClientClick
|
|
|
|
|
Thanks for your reply but still there is same error.
"The server tag is not well formed."
|
|
|
|
|
have you got runat=server in your tag?
Have you got a closiing tag?
Paste the tag here and I'll have a look at it for you
|
|
|
|
|
<asp:LinkButton OnClick = "javascript:popupwin(VrNo=<%#DataBinder.Eval(Container.DataItem,"IDD")%>,1,frmClient.HiddenClientId.value)" ID="lnkViewDetails" runat="server">View Details</asp:LinkButton>
This is my tag for Link Button..
|
|
|
|
|
Heya,
I'm having problems creating a custom group control (which I'll call XPanel for now). I'd like XPanel to be a user control consisting of several sub-panels, that the XPanel user can add their own child controls to.
I have two problems with this:
1) If I add an event handler to the XPanel.ControlAdded event that transfers the added control to one of the sub-panels, I get an error in a message box at design time: "'child' is not a child control of this parent". This doesn't happen if I create and add the control at run-time.
2) How do I allow the sub-panels to be selectable at design time? Will I have to write my own design-time painting and interaction code? At the moment, the XPanel appears as a big indivisible unit when I add it to a form.
Thanks in advance!
Andy
|
|
|
|
|
I've just tried and I can add sub-controls to 'XPanel' in the VS-designer without issue if I inherit XPanel from Panel instead of UserControl . No ControlAdded event handling required.
|
|
|
|
|
Hi Bob,
Thanks! I think I wasn't clear about it, though - I have no problem inheriting XPanel from Panel and adding child controls, but that's not quite what I want.
XPanel has N child panels S1..SN, that could look like this:
<br />
+-XPanel------------+<br />
|...................|<br />
|.+-S1--+...........|<br />
|.|.....|...........|<br />
|.+-----+..+-S2--+..|<br />
|..........|.....|..|<br />
|..........+-----+..|<br />
|...................|<br />
+-------------------+<br />
If the user of XPanel adds an instance to a form, I would like her to be able to add controls to XPanel.S1 or XPanel.S2, instead of to XPanel directly.
Which is why I wanted to handle ControlAdded, so I could pass controls added to XPanel on to XPanel.S1 or XPanel.S2.
Thanks again,
Andy
-- modified at 10:35 Monday 29th January, 2007 (got inheritance order wrong
|
|
|
|
|
Hi,
is there a wax to tell the compiler to ignore a warning for a region of code, like it is possible in C++ like this:
#pragma warning( disable : 4705 )<br />
...
#pragma warning( default : 4705 )
Thanks for Help
Greets
Roland
|
|
|
|
|
See this article on MSDN
#pragma warning disable 4705
and
#pragma warning restore 4705
Gruß
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank,
but it looks like it is a feature added in .net 2.0. is there a way to do the same in .net 1.1 as i am stuck to it for this project...
Greets
Roland
|
|
|
|
|
What is the warning that you are trying to ignore?
---
Year happy = new Year(2007);
|
|
|
|
|
The Warning CS0067: The event 'event' is never used.
It is caused by a class dummy created for a test that implements an interface that contains this events. As some events are not relevant for the test they are not used.
I can live with it but it would be nicer to have a 'clean' build.
Greets
Roland
|
|
|
|
|
You can write a protected or private OnEvent method. Its not that much code and should be done quickly even for some events by copy-and-paste. Furthermore, the methods may be useful, if you later on add more intelligence to the dummy or implement the final class.
private void OnEvent(EventArgs e)
{
if (this.Event!= null)
this.Event(this, e);
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
thank u for answering but i wish to still send the string until i click the cancel button . these ways (while 1==1) , while(true),... keep the program not responding. i have to do task manager and stop the program can u help me to solve this problem?again this is my code . thank u all.
private void OK_Click(object sender, EventArgs e)
{
string str;
ExceptionLabel.Text = "";
sp.BaudRate = 9600;
sp.DataBits = 8;
try
{
if (sp.IsOpen == false)
sp.Open();
str = "*" + fan.Items[fan.SelectedIndex].ToString() + "&" + light.Items[light.SelectedIndex].ToString() + "@" + water.Items[water.SelectedIndex].ToString() + "#";
sp.WriteLine(str);
textBox.Text = str;
}
catch (System.Exception ex)
{
ExceptionLabel.Text = ex.Message;
}
}
private void cancel_Click(object sender, EventArgs e)
{
sp.Close();
this.Close();
}
|
|
|
|
|
Create your loop in a new Thread .
And don't open a new topic, you can continue the discussion in your previous topic.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I suggest you use a timer (preferrably a System.Forms.Timer) to periodically perform
your serial port stuff once, have your OK button start the timer and your Cancel button
stop te timer.
Alternatively, provide a bool variable "portRunning"; let your start button set
portRunning true and make it create a new thread that contains a while(portRunning) loop
with your serial port stuff, and let your Cancel button set portRunning false.
I prefer the timer approach since then you achieve an upper bound for the amount
of data that gets transmitted per second.
PS: none of these will run infinitely, your computer (or Windows) will come to an end sooner
or later...
Luc Pattyn
|
|
|
|
|
Hi, i wish to create an infinite loop to send a string to an I/O port infinitly can anyone help me please? my code code is:
private void OK_Click(object sender, EventArgs e)
{
string str;
ExceptionLabel.Text = "";
sp.BaudRate = 9600;
sp.DataBits = 8;
try
{
if (sp.IsOpen == false)
sp.Open();
str = "*" + fan.Items[fan.SelectedIndex].ToString() + "&" + light.Items[light.SelectedIndex].ToString() + "@" + water.Items[water.SelectedIndex].ToString() + "#";
sp.WriteLine(str);
textBox.Text = str;
sp.Close();
}
catch (System.Exception ex)
{
ExceptionLabel.Text = ex.Message;
}
}
private void cancel_Click(object sender, EventArgs e)
{
sp.Close();
this.Close();
}
|
|
|
|
|
|
while (1 == 1)
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
or the old C++ goody:
for(;;)
|
|
|
|
|
In VS 2005, I'm trying to add a menu item to the Project context menu, so that when I do command line stuff for the project output I can just right-click and select, "Command Prompt", and a command prompt opens up in the right folder.
Explore the commands and menubars etc. on saturday, I could not identify to which object I must add the command etc. Can anyone help me with this?
Apologies if this is too OT, but I couldn't find a VS 2005 forum.
|
|
|
|
|
Hi,
I am trying to expose my .NET 2.0 class as a COM type using the following
attributes for the attributes
[ClassInterface(ClassInterfaceType.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
I have the "Register for COM Interop" build property set to true. I also have two functions in the class to register and unregister the COM with the registry. But when i try to build it in VS.NET 2005, i get the following error "XXX.dll does not contain any types that can be registered for COM Interop" and "XXX.dll does not contain any types that can be Unregistered for COM Interop". The same code works perfectly in VS.NET 2003. Anybody know of any reasons why this is happeneing or what i am doing wrong?
Thank You,
A.Ansari
Asadullah ansari
|
|
|
|
|
Hi All,
Is there anyway to access the reuuning instance of an object in a application from another application. Both the applications are built using C#. I have tried using the GetActiveObject, but it seems used for COM objects. Is there any method available for managed objects. I don't want to use remoting.
Thanks in advance
Diana.
|
|
|
|
|
Hi diana it's very nice question. I like this kind of developement.
I think This possible through Interprocess communication.
Actually i have no time for implement this thing.
Plz refer this url it may be assist.
http://msdn2.microsoft.com/en-us/library/aa446520.aspx
http://msdn2.microsoft.com/en-us/library/aa365574.aspx
Plz inform what kind of you have exact need.
If u face further problem plz inform me.....
-- modified at 12:17 Monday 29th January, 2007
Parwej Back...............DON of Developer.......
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|