|
Hmmm works fine for me.
Care to post some code?
|
|
|
|
|
I uploaded the solution source code (VS2005) to my website - since I didn't know what code to post - it's only 27k. I hope you can help me.
http://www.jrsoftwares.com.br/JRFW.zip
Thanks,
Dirso
|
|
|
|
|
This worked fine for me:
<br />
<br />
mmMain.Items.Add(new ToolStripMenuItem("Testing"));<br />
<br />
I can't spot why it's breaking on your end.
|
|
|
|
|
Hi,
Not breaking, it works for me too. My question is about the designer: why can't I edit the control at design time?
Thanks,
Dirso
|
|
|
|
|
Opps I've misinterpreted your question.
Your problem is one that is often brought up.
this might help.
There is a good article on this topic somewhere on codeproject as well, but the search is not working for me at the moment.
Cheers,
|
|
|
|
|
Hi,
Thanks for your help. I think this is the best I can get from the current VS version, hopefully it gets better with 2008 or 2100
Thanks a lot,
Dirso
|
|
|
|
|
Well, it was a nice article and at least the form properties are enabled (they weren't before). But I still can't edit the menu itens in the designer. If you find anything else about this issue, I'll appreciate. If I find the solution by myself I'll post it here as well.
Thanks a lot,
Dirso
|
|
|
|
|
Is it possible/valid to call an extension(ext.) method from another ext. method?
Like I've two ext. methods which extend DataContext class : (1) SaveEntity(this DataContext dc, T Entity) & (2) SaveCollection(this DataContext dc, List<T> Colln)
I want to call SaveEntity method from(within) SaveCollection method in a foreach loop like :
foreach(T entity in Colln)
{
if(entity.IsNew) dc.SaveEntity(entity);
if(entity.IsModified) dc.SaveEntity(entity);
....
}
I've tried with various syntax-combinations for calling "SaveEntity" from "SaveCollection" method but end up with compilation-errors.
Will appreciate if someone can let me know (or direct to some link) if this is a valid/supported-feature and if yes, what could be the syntax for calling "SaveEntity" method.
Thanks for reading this & your replies,
Rajesh Moriyani
rkmoriyani@gmail.com
|
|
|
|
|
Calling extension methods from another is quite possible.
I think the problem is that your class is named something like Extensions<t>, which causes the problem. Instead of putting T in the class, put it in the method signature like so: public static void SaveEntity<t>(this DataContext dc, T Entity) where T : whatever
Also, is the containing class static?
If there are still some compilation errors, please post them.
|
|
|
|
|
Yes you can an extension method within inside an extension method.
public static class ExtensionClass1
{
public static string Info<T> (this T obj) where T:class
{
return obj.MoreInfo<T>() + ":" + obj.GetType().Name;
}
}
public static class ExtensionClass2
{
public static string MoreInfo<T>(this object obj) where T: class
{
return obj.GetType().Assembly.FullName;
}
}
Tariq A Karim
http://moplah.blogspot.com/
|
|
|
|
|
I've created buttons automatically based on rows of information. When someone pushes the button I call the eventhandler button1_Click(object sender, EventArgs e).
Is there anyway to tell what the name of the button is? I'm using c# in asp.net. When debugging i can see the clientid but cant get it from sender.
|
|
|
|
|
Cast the sender object to a Button:
Button myButton = sender as Button;
if(myButton != null)
{
string name = myButton.Name;
}
|
|
|
|
|
That did it thanks. Since im using asp i used myButton.id instead of name. Thanks again.
|
|
|
|
|
Hi All,
I have a datatable with some data :
ActivityNr ActivityStartTime ActivityDuration
001 20:30 00:30
002 20:30 00:40
003 20:40 00:30
004 20:50 00:30
005 20:55 00:30
As you can see, Activity 001 and 002 have the same StartTime(20:30), bud activity 002 has a longer Duration(40 minutes) then Activity 001(30 minutes).
Now i have to check all activities StartTimes and when they have the same StartTime(like 001 and 002), then i have to check the 'ActivtityDuration' of those Activities and delete the Activity with shorter duration from the datatable.
Assuming the datatable above, the end resulat most be:
ActivityNr ActivityStartTime ActivityDuration
002 20:30 00:40
003 20:40 00:30
004 20:50 00:30
005 20:55 00:30
001 is deleted because it had the same starttime as 002, bud a shorter duration.
Can anyone help me with this issue with some code ?
Thanx.
|
|
|
|
|
OK guys its clunky but it works lol. Still have a little issue though maybe you guys can help me with a solution or just tell me it cant be done either way.
anyway, I can display the image and if the user types in the captcha it will validate, however since i had to do a if (!Page.IsPostBack) in order for the captcha text not to override itself upon every Async post back it now wont refresh the image if someone clicks get new image.
is there a way i can make this Unaffected by anything causing a post back except my label button?
The Control shown below is being placed onto my Default.aspx page. and the lblbutton is named lbtnCaptchaRefresh.
if i remember right i cant cross name spaces in a custom control since the name space of the current project will never be the same between two projects.
I've also thought about using it as an embedded resources, but not sure how that would work on dynamically created images.
here is the code:
1. using System;
2. using System.Collections.Generic;
3. using System.ComponentModel;
4. using System.Text;
5. using System.Web;
6. using System.Web.UI;
7. using System.Web.UI.WebControls;
8. using System.Drawing;
9. using System.Drawing.Drawing2D;
10. using System.Drawing.Imaging;
11. using System.IO;
12. using System.Net;
13.
14. namespace Captcha
15. {
16. [DefaultProperty("Text")]
17. [ToolboxData("<{0}:Captcha runat=server>")]
18. public class Captcha : WebControl
19. {
20.
21. [Bindable(true)]
22. [Category("Appearance")]
23. [DefaultValue("")]
24. [Localizable(true)]
25.
26.
219. public string BuildImage()
220. {
270.
313. captchafont.Dispose();
314. captchafont2.Dispose();
315. captchagraphic.Dispose();
316. try
317. {
318. captchabmp.Save(imageurl, ImageFormat.Jpeg);
319. }
320. catch (Exception ex)
321. {
322. Context.Response.Write(ex.ToString());
323. }
324. HttpContext.Current.Session.Add("CaptchaURL", IMAGE);
325. HttpContext.Current.Session.Add("captchastr", captchastr);
326.
327.
328.
333.
334. captchabmp.Dispose();
335.
336.
337. return imageurl;
338. }
339. protected override void OnInit(EventArgs e)
340. {
341. base.OnInit(e);
342. if (!Page.IsPostBack)
343. {
344. BuildImage();
345. }
346.
347. }
348.
349. protected override void Render(HtmlTextWriter writer)
350. {
351.
352.
353. writer.RenderBeginTag("img src=\"" + imageurl + "\"");
354. writer.RenderEndTag();
355.
356. base.Render(writer);
357.
358. }
359.
360.
361. }
362. }
|
|
|
|
|
I guess you want the ASP.NET forum ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Well it is an asp.net project with C# code behind, however the captcha is all C# i need to be able to grab the asp control from my default page from the Custom Server Control which is entirely C#.
|
|
|
|
|
I have 2 button (1) Select All (2)DeSelect All button. Select All button should select all the checkboxes in the GridView...Importantly when the paging is allowed...
The problem is, when paging is allowed, the checkbox is checked only in the first page not on the second page and the subsequent ones. The following code shows the code.
How can I get every check boxes selected? how to do with Javascript? If possible, can we do without Javascript.. with C#.
Please help.
protected void Select_Click(object sender, EventArgs e)
{
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox chk = row.FindControl("chkSelect") as CheckBox;
if (chk.Checked == false)
{
chk.Checked = true;
}
}
}
Sanjeev
|
|
|
|
|
hey..did u get the ans for ur prob?? i m stucked wit d same prob n not findin any solution for it..i wud be happy if u cud share d code ...
thanks
|
|
|
|
|
I am developing a chat/message server application. I am trying to create a fast and efficient way to keep track of which clients are communicating with each other. My solution for this is to assign a unique "chat session id" to a group of 2 or more people that are communicating with each other. And each person that are within a chat session have their own unique Id for that session. So each unique session has its own table of users with their socket information and other stuff. So what I have done is create a hashtable with the session ID as the key and the user datatables as the objects in the hashtable.
First question: Do you think this is an efficient way to do things?
Second question: Will using in memory datatables and hashtable give me better speed performance than using an actuall database(sql or mysql)?
Third question or would it more efficient to have a datatable that contians hashtables of user ids?
modified on Monday, June 9, 2008 2:42 PM
|
|
|
|
|
hi...
im working on a project and im getting in trouble here with the undo function...
so..lets see...the user does an action in a picturebox...now what i want is..when he clicks a buuton called "Undo" the last action will be undone...how the hell do i do that? thanks in advance
P.S
if i want to use a blank sheet to instore a large code texts but still use them in the program how do i do that?
andd...how do i cause a second form to show it self lets say..on a push of a button while another form is already running?
modified on Monday, June 9, 2008 1:59 PM
|
|
|
|
|
Wow - you don't want a lot, do you? There are many ways you can do the "Undo" functionality, but the easiest is probably this[^] implementation.
|
|
|
|
|
To support undo/redo operations, you'll want to read up on the "Command" design pattern. Google "Command Design Pattern" and you'll get a myriad of explanations.
|
|
|
|
|
MrAdar wrote: the user does an action in a picturebox...
At this point, your design is broken. IF there are actions, you probably should not use a picturebox.
MrAdar wrote: how do i cause a second form to show it self lets say..on a push of a button while another form is already running
You really need to buy a book.
You want a modeless form, which means you call Show instead of ShowDialog.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
I have a TreeView control on my .aspx page. When I load the page, for any selected last child node, I want to show its entire path (to the parent first root node) in RED color.
Please can anyone tell me how I can achieve this?
Thank you.
|
|
|
|