|
I have to make an application for windows as well as a same application for mobile. It is final project of my master degree and i m very confused to decide that which type of application should i have to design.
Ahmed
|
|
|
|
|
M. Ahmed wrote: It is final project of my master degree
You want to be easy...Windows. I would do it on mobile...but that's just me.
Do your best to be the best
|
|
|
|
|
Hi,
I am creating dynamic button and a textbox on my asp.net page on Page_load event.I am not able to raise event of button controll.Please guid me how can I perform any opration on click event of button.
{
TextBox TryTest = new TextBox();
Button btn = new Button();
TryTest.Font.Bold = true;
TryTest.ID = "Text1" ;
btn.ID = "Btn1";
btn.Attributes.Add("runat", "server");
btn.Attributes.Add("OnClick", "Button1_Click");
btn.Attributes.Add("Text", "Press Button");
PlaceHolder1.Controls.Add(new LiteralControl(" "));
TryTest.Text = "";
PlaceHolder1.Controls.Add(TryTest);
PlaceHolder1.Controls.Add(btn);
PlaceHolder1.Controls.Add(new LiteralControl(" "));
}
Girish Soni
|
|
|
|
|
This is not the ASP.NET forum.
You have to add your control before the page load event, in order for it to exist when viewstate is restored. Otherwise, your control is not there, and the viewstate is lost, including events.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If you add OnClick as an attribute, it will just end up in the client code. It's only when you write it in the markup code that it is compiled into code that binds the event handler.
When you create the control dynamically, you have to write the code that binds the event handler yourself:
btn.Click += new EventHandler(Button1_Click);
The runat and Text attributes are also only used when you write the control in the markup code. If you add them as attributes, they will end up unchanged in the generated html code, where they have no meaning at all. Use the Text property of the control to set the text:
btn.Text = "Press Button";
---
single minded; short sighted; long gone;
|
|
|
|
|
i know it is simple but i am hang , i have an string to search in string i have to search digits and spe cial characters and alphabets how can i put condition in c Sharp in if condition.
i have use it before but now i forget the way how to search in a string.
|
|
|
|
|
Try using the Char class. It has some static functions that check if your character is a digit, letter and so on:
foreach (char c in s.ToCharArray())
{
if (Char.IsDigit(c))
{
Console.Write();
}
}
Do your best to be the best
|
|
|
|
|
You can use the Contains method of the strng class, or for more complex searches, use regular expressons, for example, you can use \d to search for any digit in a string, using regex.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
but how can i find specific charter like "/" , "\" or something else
|
|
|
|
|
string email;
for(int i=0; i<=email.Length - 1;i++)
{
if (email[i] == '(' || email[i] == ')' || email[i] == '+' ||
email[i] == '-' || email[i] == '*' || email[i] == '/' ||
email[i] == '=' || email[i] == '&' || email[i] == '%' ||
email[i] == '#' || email[i] == '^' || email[i] == ''' ||
email[i] == '?' || email[i] == '>' || email[i] == '<' ||
email[i] == ';' || email[i] == ':' || email[i] == " ")
{
//do something
}
else
{
//do nothing
}
}
Ahmed
|
|
|
|
|
Wow, after three decent answers, you felt the need to post this ? It's really a messy way to go.
M. Ahmed wrote: for(int i=0; i<=email.Length - 1;i++)
Why not just i < email.Length ? Why not just foreach (char c in email) ? Why not store your special chars in an array, so the code is maintainable, or just use regex ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am establishing the COM Interoperability where I'm exposing the functionality in my .net component to client developed in either vb 6.0 or vc++.
I don't have any issue regarding how to implement the COM Interoperabiliy. My problem is, to make my call from client to .net component successful, I have to put my client application also in the same path where my .net component is. If I put my client application in a path other than my .net component path then call is not successful as it fails to find out some DLL dependancy. Can someone tell me how I can run my client application independent from the .net component path.
I hope I'm clear with my question. Thanks & Regards,
|
|
|
|
|
If your DLL is a COM dll, then it should register as such, and run from where-ever you like. Are you calling it from C++ or VB6 ? What is the dll it cannot find ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
My dlls are not COM dll so I'm not registering them with registry. I have a .net component (dll) which can be accessed through COM interop by VB or VC++ client. my .net component is using some dlls so at the runtime (i.e. during client call these dlls could not be found)
|
|
|
|
|
OK, well, it doesn't sound to me like you're using COM interop at all. Where does COM come into it, if you're not writing COM dlls ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I think we are not talking on the same line. Let me elaborate.
I have a .net application and some of the functionality of this application I have exposed through a dll. I have used COMVisible attribute to expose the functionality in this dll to other application. I register this dll with registry using regasm tool (and not through regsvr32 or something.... that's why I said I'm not registering the dll with registry). Now client developed in VB or VC++ can use this dll (registered as COM with registry) to consume the functionality exposed by my .Net application.
When I put my client application in a path other then my .net component path it fails to find out the path for the dependency dlls.
I hope now question is clear. Sorry for replying to your question is hush hush...
|
|
|
|
|
KrunalC wrote: that's why I said I'm not registering the dll with registry
KrunalC wrote: registered as COM with registry
OK, spot the contradiction.
If your DLL is COM, it's in the registry and you can put it anywhere. It may still need some dlls ( it sure needs the .NET framework ), and that could be your issue. Hard to say, based on the level of detail you've provided ( I did ask once about the dlls it needs, but you did not give a specific reply )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
the COM interop dll is also using some dlls developed as part of our application. so it is failing to find these dlls n not the .net framework dll.
What i have done is I have put codebase entry in my registry along with dll registration. So i think it finds the COM Interop dll but com interop dll in turn fails to get the dependancy dlls.
hope things are clear now. If not pls revert back for more clarification. Thank you very much for your persistent support. I really appreciate it.
|
|
|
|
|
hi guys, i want to picking row from my database(sql server 2000) with cycling form. for example my database contain.....
name age roll no
first row:- samuel 23 900041
sec row:- sam 22 900042
third row:- raja 20 900044
.....
in this my request i am retrive first row and then my second request i want to pick sec row as well as i move first row into third row...
so if u have any solution reply me asap..
|
|
|
|
|
Hello,
I'm having a problem Serializing/Writing the objects that were initially generated by xsd.exe and then extended (by adding attributes) via partial class. Since it will be hard to read if I paste all my code, I'll try to explain it instead.
XSD generates classes from the schema. IN my case let's call them:
public partial class ParentClass {}<br />
public partial class ChildClass {}
All of these are generated inside a DataModel.cs class.
So I created another DataModelEx.cs class where I added the following:
public partial class ParentClass<br />
{<br />
private string dataRootField = string.Empty;<br />
<br />
public string DataRoot<br />
{<br />
get { return dataRootField; }<br />
set { dataRootField = value; }<br />
}<br />
}<br />
<br />
public partial class ChildClass1<br />
{ private ParentClass parent = null; }
Adding these, when I try put values in the class and serialize it, this is the error that I am getting:
Error: There was an error reflecting type 'NAVITAIRE.SkyPlan.utility.data.DirectorySettings'.<br />
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel)<br />
at System.Xml.Serialization.XmlReflectionImporter.ImportElement(TypeModel model, XmlRootAttribute root, String defaultNamespace)<br />
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace)<br />
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)<br />
at System.Xml.Serialization.XmlSerializer..ctor(Type type)<br />
at NAVITAIRE.SkyPlan.utility.Util.WriteDataToXml(String outputFile, Object data) in C:\workspace\PlanningSuite_Local_Dev\gui\src\utility\Util.cs:line 1741
My guess is that I may be missing some tags like the following in declaring my attributes:
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]<br />
[System.SerializableAttribute()]<br />
[System.Diagnostics.DebuggerStepThroughAttribute()]<br />
[System.ComponentModel.DesignerCategoryAttribute("code")]<br />
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]<br />
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
I am not familiar about these [] tags before declarations, so please help me out. I tried experimenting by placing some [System.Xml.Serialization.XmlIgnore()] before the new properties but it didn't seem to work, or maybe I just placed them incorrectly.
Thank you for your help!
Sincerely,
Rafferty
|
|
|
|
|
Nasty problem.
Make sure your class is marked with [Serializable]. Certain complex types cause problems too I believe. Dictionary<> and the sort. Try putting [XmlIgnore] infront of these (which will prevent serialisation) and see if that helps, you may have to use more primitive types if that helps.
[DebuggerStepThroughAttribute] prevents the debugger from stepping into the generated code, not always that helpful so just find and replace these with an empty string may help with debugging.
Regards,
Rob Philpott.
|
|
|
|
|
Found the problem. Seems like a cyclical problem happens when you use "parent" objects in classes like these.
Thanks guys!
Rafferty
|
|
|
|
|
I'm using ClickOnce for deploying my smartclient (CAB) application. There are a lot of modules in my applications. When the new version of those modules have been deployed, I wanna show the list of modules that need to be updated to the user before downloading those latest version.. ( like Firefox extension's auto-updates style )
My question is: How can I get the list of latest module?
Thanks in advance.
|
|
|
|
|
hi all
plz help me
i am inserting date to the text box on the datagrid template.There is 2 column for that. one receive date and the other due date. due date should be greater than receive date. and the date format is dd/mm/yyyy. how to validate this. since the date format is dd.mm.yyyy, am not able to compare it with different month.plz help me to solve this. am doing this from past 4 days. but didnt end up with a solution
sample code is given below
if(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text != "")
{
try
{
DateTime txt=Convert.ToDateTime(((TextBox)(dgDetailData.Items[total].Cells[6].Controls[1])).Text);
DateTime tst=Convert.ToDateTime(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text);
string date=month+"/"+day+"/"+year;
if(DateTime.Compare(txt,tst)>0)
{
lblmsg.Text="error";
lbl1.Text=date.ToString();
}
else
{
lbl1.Text=txt.ToString();
InsertParam[9].Value=Production.FORMATYMONDTIME(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text);
}
}
catch(Exception err)
{
RegisterStartupScript("startup","<script>window.alert('1.Error:"+err.ToString()+"')</script>");
}
}
else
{
InsertParam[9].Value=DBNull.Value;
}
In this code the error occuring is if the received date is 01/10/2007 n due date id 30/09/2007, it is inserting value. if it is of same month it is working properly. ie 01/10/2007 n 10/10/2007 it accept and if it is 10/10/2007 n 01/10/2007 it is not accepting.
|
|
|
|
|
Hey all,
I've long been using CodeProject as a valuable resource, but have come to a problem that I can't find a solution for.
I have a .NET 2.0 app, written entirely in C#. In it, I have several controls (some simple, some complex), which I'd like to display detailed data about in a custom tooltip. I've got the tooltip content done and can easily make it be a Form or UserControl, whichever the tooltip class would need.
Ideally, I'm looking for some free class, where I can just do something like...
<br />
WonderfulToolTip tip = new WonderfulToolTip(myTooltipContentControl);<br />
<br />
...<br />
<br />
tip.Show(new Point(300, 400));<br />
<br />
...<br />
<br />
tip.Hide();<br />
I've looked around here, and other websites, and seen at least example of this working, however it wasn't free, and the code seemed way too in-depth, since it was a full control library, and I wouldn't be able to pick out just part I need. I found several different related options, like comboboxes with custom tooltips, or specific custom tooltips that didn't allow you to provide your own control. I know the funcitonality is there, but untangling it from the mess of things that aren't what I want seems very daunting. I've been a .NET C# developer from the start, so my eyes tend to glaze over when I see a huge chunk of code filled with windows API calls, endless enums, and other native code. I'd prefer not to reference any huge control libraries; I'd just like a class or two to add to my project.
Perhaps the desire for a simple custom tooltip class is a bit idealic, I'm not sure. Can anyone point me to the closest I can get, if nothing like what I'm looking for is available? Thanks very much for your time!
|
|
|
|