|
thanx . can you help me in asp problem ?
|
|
|
|
|
hi,
I didn't get you that what problem that you mentioned. Is it Asp.Net ?. See there is no difference in windows or web c# programming style.;)
<blink>S r e e j i t h N a i r
|
|
|
|
|
OK. i have a webpage includes textBoxs i want to use an event to tell me if the cursor left the current textbox or not ? somthing like last focus event or somthing !
|
|
|
|
|
hi,
You can set the value of AutoPostBack property of your textbox to true. Then it will automatically update the value for each value change.
<blink>S r e e j i t h N a i r
|
|
|
|
|
sorry sreejith my supervisor say no to this solution
any thing else using JavaScript ?
|
|
|
|
|
hi,
No idea.Post this in asp.net forum. And be specific on your requirement.
<blink>S r e e j i t h N a i r
|
|
|
|
|
Is there a way to add code to the delete key pressed on a datagrid? I want a messagebox to pop up when the key is pressed to allow the user to confirm or cancel the deltetion of the datagrid row.
Thanks,
Reinier.
|
|
|
|
|
You need to add an event handler to datagrid for OnItemDataBound event.
In that handler you need to lookup a delete button and attach client side script to it. You will do it using button's attribute collection.
something like this:
myBtn.Attributes.Add("onclick","javascript:myConfirmJSFunction()");
Hope this helps
r.
|
|
|
|
|
Thanks for the reply.
I think you are referring to a datagrid in webforms, i'm looking for a answer on a datagrid in a windows form, when the delete key on keyboard is pressed.
|
|
|
|
|
|
Could you tell me How can I get the test tool for getting code coverage of C# project?
|
|
|
|
|
|
Thank you ! But I can not find the related document about C#, however,I will try!
|
|
|
|
|
Hi all,
Did anyone know that C# internal have double buffering in its Forms for drawing polygon or I need to code it by myself?
If it have, how can I call it ?
thanks
|
|
|
|
|
Add this line to your custom control when u are initializing:
this.SetStyle(ControlStyles.DoubleBuffer, true);
|
|
|
|
|
As stated by MSDN: To fully enable double-buffering, you must also set the UserPaint and AllPaintingInWmPaint style bits to true.
this.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint,
true);
www.troschuetz.de
|
|
|
|
|
using proxy class can't convenient dynamic invoke web services.I want to send and receive soap message myself in my program,i think it is a better way and this method give us more flexible,but i don't know how to do it in c#,someone can tell me the way ,thanks very much!
|
|
|
|
|
You can get more control over SOAP messages by creating a SoapExtension. You have the ability to view what's on the wire, do your things at 4 different stages... before and after serializing and deserializing. See MSDN for more details on soap extensions.
|
|
|
|
|
Hi
There are number of ways. First you try to explore 'SoapHttpClienProtocal' class of 'System.Web.Services.Protocols' assembly. Web service proxy class is derived from this class only. This will be useful only if you familiar in WSDL and Serialization. So first you learn WSDL (Web Service Description Language) it contains information about the webservices, parameterlist for each method in the service and class defination.It is an XML file. so we can deserialize into a class object and we can read it. Once we knows method and parameter then we can Invoke it using our proxy class derived from ‘SoapHttpClietProtocal’ class or 'HttpClientRequest',but the latter one is not advisable.
Still you feel you are not able to solve this let me take time and develop a sample application for you. Ok
Feel free to contact me
M.Sendilkumar
Senior Software Engineer
TVS Infotech Ltd
Chennai,India.
|
|
|
|
|
I can dynamic invoke web services using that code:
This is synchronization invoke
/// <param name="url" />WebService'shttp
/// <param name="namespace" />WebService'namespace
/// <param name="classname" />WebService'classname which want to invoke
/// <param name="methodname" />
/// <param name="args" />paraneters
/// <returns>result
/// object obj = InvokeWebservice("http://localhost/GSP_WorkflowWebservice/common.asmx","Genersoft.Platform.Service.Workflow","Common","GetToolType",new object[]{"1"});
///
///
private object InvokeWebservice(string url, string @namespace, string classname, string methodname, object[] args)
{
try
{
System.Net.WebClient wc = new System.Net.WebClient();
System.IO.Stream stream = wc.OpenRead(url+"?WSDL");
System.Web.Services.Description.ServiceDescription sd = System.Web.Services.Description.ServiceDescription.Read(stream);
System.Web.Services.Description.ServiceDescriptionImporter sdi = new System.Web.Services.Description.ServiceDescriptionImporter();
sdi.AddServiceDescription(sd,"","");
System.CodeDom.CodeNamespace cn = new System.CodeDom.CodeNamespace(@namespace);
System.CodeDom.CodeCompileUnit ccu = new System.CodeDom.CodeCompileUnit();
ccu.Namespaces.Add(cn);
sdi.Import(cn,ccu);
Microsoft.CSharp.CSharpCodeProvider csc = new Microsoft.CSharp.CSharpCodeProvider();
System.CodeDom.Compiler.ICodeCompiler icc = csc.CreateCompiler();
System.CodeDom.Compiler.CompilerParameters cplist = new System.CodeDom.Compiler.CompilerParameters();
cplist.GenerateExecutable = false;
cplist.GenerateInMemory = true;
cplist.ReferencedAssemblies.Add("System.dll");
cplist.ReferencedAssemblies.Add("System.XML.dll");
cplist.ReferencedAssemblies.Add("System.Web.Services.dll");
cplist.ReferencedAssemblies.Add("System.Data.dll");
System.CodeDom.Compiler.CompilerResults cr = icc.CompileAssemblyFromDom(cplist, ccu);
if(true == cr.Errors.HasErrors)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
foreach(System.CodeDom.Compiler.CompilerError ce in cr.Errors)
{
sb.Append(ce.ToString());
sb.Append(System.Environment.NewLine);
}
throw new Exception(sb.ToString());
}
System.Reflection.Assembly assembly = cr.CompiledAssembly;
Type t = assembly.GetType(@namespace+"."+classname,true,true);
object obj = Activator.CreateInstance(t);
System.Reflection.MethodInfo mi = t.GetMethod(methodname);
return mi.Invoke(obj,args);
}
catch(Exception ex)
{
throw new Exception(ex.InnerException.Message,new Exception(ex.InnerException.StackTrace));
}
}
I want to asynchronous invoke web services,because the web services are dynamic,and are more than one ,I write a callback , that call back can't deal with all web services.So I want to send soap message myself.If you can resolve my question,give me a letter,thanks.
My question is that:
I know the wsdl of the web services,I want to dynamic asynchronous invoke web services,I use proxy class , the callback function I can't use it to deal with all web services callback.
|
|
|
|
|
hi,
I have tried to import gdi32.dll into my c# project, and also I'm using its CreatePen function.
the declaration is :
private static extern IntPtr CreatePen(int Pen, int nWidth, int Color);
now the problem is, I don't know how to convert the C# color to the value that is suitable for CreatePen use. The MSDN tell us to use RGB marco, but I can't use this marco, so I tried to use Color.ToArgb(), but still not correct.
could anyone help ? Thank you
|
|
|
|
|
Why exactly do you choose to import GDI32.dll into your project? That's a little strange when you have a full managed way of doing that.
Just use the System.Drawing namespace: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawing.asp
To create a Color do this:
Color c = Color.FromArgb(....);
To create a Pen do this:
Pen p = new Pen(c);
Do drawing in the Paint event or override OnPaint() method of the control. Use the Graphics object to do all your tasks.
|
|
|
|
|
yes, I know this we can do it inside OnPaint() events,
but for convenience, using window GDI is faster and more smooth than using C# only. Actually, I want to draw some dash rectangles over some objects, so using gdi32.dll, we dont' need to re-paint all pictures..
the problem of getting the color int value to CreatePen is quite strange, is it also depends on what value of drawmode I set inside SetROP2() ??
|
|
|
|
|
azusakt wrote:
but for convenience, using window GDI is faster and more smooth than using C# only.
P/Invoking .DLL's is convenient? Since when? Actually, you won't get any performance increase at all since you have to marshal all kinds of stuff back and forth to unmanaged code, thereby killing any performance gain and even, possibly, slowing the drawing down.
Also, your just recreating the code in the System.Drawing namespace. It's a .NET Class Library wrapped around the GDI32.DLL, among a couple others. So why are you re-inventing the wheel?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No, I mean the convenience is we can draw some thing over the screen and we're no need to repaint all objects in our OnPaint Event. like XOR drawing.
actually, I need to draw some rectangles over some painted thumbnails and need to repaint every times when the mouse drag and move, but System.Drawing namespace seems have no XOR drawing, if I use Drawing namespace, yes, it can be done, but need to refresh every time.
but anyway, my question is not discussing for why need to use gdi32.dll, is how can I convert the C# color value to the vaule used in CreatePen ?
Thanks for help
|
|
|
|