|
Hi all,
I have an ASP.Net 2.0 application that my customers use. I now have the need to allow my customers to connect via their PDAs. Just one ASP.Net page is involved here. This page has a Gridview control and the user can enter some info which updates a SQL table. The gridview has some textboxes where the user can change some values. Pretty standard stuff. So I made the gridview real small so that it will fit on a PDA. Everything works except that my textboxes are very wide. I tried making the width small but no luck. But other properties like font=bold, font-size, forecolor, etc. I can change and these change do appear on the PDA. But everything I try to make the width small fails. It is very frustrating since this will perfectly if I can just get these darn widths correct! I know there is a mobile framework and special controls just for mobile devices. But that would require me to write a new web page and learn about these new controls. I was hoping I could salvage my existing web page. Can anyone help?
Thanks,
Bob
|
|
|
|
|
hi,
Is it Possible to create a base web control and then inherit from it in other user web controls?
For example, id like to create a web control that encapsulates all the ajax logic, a title bar, some buttons etc. Then id like to create some sub controls that would inherit from that, so that i could create, for example a gridview control, and it would be ajax enabled and have a title bar etc...
I cant see any way to do this in visual studio (2005). When i create a control, i cant set that as the superclass for another control, ie: inherit from it.
Ive been programming for several years, but never worked on a web project large enough to think about something like this. If its not possible, what are the general ways people encapsulate common functionality in web controls on the web?
Thanks
|
|
|
|
|
Dermot O S wrote: When i create a control, i cant set that as the superclass for another control, ie: inherit from it.
Yes, you can.
What have you tried that led you to believe that you can't?
---
single minded; short sighted; long gone;
|
|
|
|
|
Well, In a web project, I create a control and call it BaseControl.ascx I put some text into it eg: "This is the base control".
I then create another control and call it MyControl.ascx. I modify the code-behind to inherit from BaseControl instead of System.Web.UI.UserControl and in the markup i change the Inherits= value to BaseControl.
I attempt to build it and i get 5 errors
I get 4 x
Error 1 'Context' is not a member of 'BaseControl'. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sitetwo\51cc156d\f50c0ac4\App_Web_ms78fiky.0.vb 37
and one:
Error 3 property 'SupportAutoEvents' cannot be declared 'Overrides' because it does not override a property in a base class. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sitetwo\51cc156d\f50c0ac4\App_Web_ms78fiky.0.vb 68
When I double click the errors it brings me into that randomly named, auto generated file: App_Web_ms78fiky.0.vb
Am I doing this wrong? Thanks for your previous quick reply by the way.
|
|
|
|
|
I don't think you need to change the inherits= value in the markup...
|
|
|
|
|
Paddy is right. The Inherits property determines what class the ascx page is inheriting from, and you don't want to change that, as that would turn the ascx page from a "MyContol" to a "BaseControl".
---
single minded; short sighted; long gone;
|
|
|
|
|
Either way it doesnt work, its still the way i described it in my first post.
|
|
|
|
|
I have install first VS 2005 and then VS 2003.
Now i am getting subject error while debug any vs 2003 ASP.NET project.
Can anyone please guide what i have missing.
|
|
|
|
|
aquarious2020 wrote: Now i am getting subject error while debug any vs 2003 ASP.NET project.
What is "subject error"? Can you please post the error message that you are getting?
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
You wrote: Unable to start debugging on web server
Okay. got you.. (At least, you should re-write the error message instead of saying "subject error".)
I and my team used to face that problem sometime ago. I will tell you all attempts that we made while trying to solve that problem. I'm not sure which attempts actually solved the problem but I'm sure the problem will be solved after trying all attempts.
Check-out this link. I posted about this last month..
[Weekly - QASW] - Questions and Answers in Software Development
Hope it helps..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi,
I am a newbie and developing a web application in ASP.NET 2005. In one of my page I am having three different Usercontrols. However when I run my page in FF everything seems fine even after postback. But in IE after Pageload when i click buttons or even change options from Dropdown nothing appears to happen.(My dropdown is having event "SelecetedIndexChanged" and Autopostback is also set as true). Although the page postbacks, but rather to go in any event handlers (except Page_Load) it directly jumps to usercontrols.cs file after checking postback property and leaves from there right only rather to continue with specific eventhandlers. I tried by removing one of my user controls and everything works fine. I don't know how to solve this problem. I have also used EventValidation="false" in Page property section but of no use.
Just surprised to see FF is working fine with the same user controls and I even dont have any particular settings for my IE browser.
I modified, developed a new Usercontrol but alas of no use.
My Usercontrols HTML code is satisfying all W3c norms and nothing seems wrong in it (I hope so) and attached here.
Need Immediate Help,
Any Replies appreciated.
Thanks,
naresh511@gmail.com
User Controls HTML Code:
| | | Forgot Username or password? |
|
|
|
|
Naresh
|
|
|
|
|
Your HTML Code that you pasted doesn't show properly in your post. What about making small sample ASP.NET project that works fine in FF and not in IE and show to us?
We will download and try to reproduce your error at our site. then, will let u know the result.. what do you say?
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I am trying to make a start on creating a website (something I don't have a huge amount of experience with). I choose the asp.net website template and the solution is created and loaded for me. The problem is that when I go to look in the solution folder I find 2 folders, Website1 and Website1(2). Website1 contains the code files, Website1(2) contains the solution files.
Can someone please tell me why this is behaving like this?
Thanks.
|
|
|
|
|
jimbaloo wrote: I am trying to make a start on creating a website (something I don't have a huge amount of experience with). I choose the asp.net website template and the solution is created and loaded for me. The problem is that when I go to look in the solution folder I find 2 folders, Website1 and Website1(2). Website1 contains the code files, Website1(2) contains the solution files.
Can someone please tell me why this is behaving like this?
As default, Visual Studio used to create two folders for website.
1. WebSite Code : %userprofile%\Documents\Visual Studio 2005\WebSites\MyWebSite
2. Solution file : %userprofile%\Documents\Visual Studio 2005\Projects\MyWebSite
Normally, the name of folder under Projects and the folder name under Websites will be the same. but I think the reason why the name (WebSite1 and Website1(2)) are different in your case is that there might be one folder called Website1 already exists in that path so that the name automatically changed from Website1 to Website1(2).
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I have a GridView which has a non data bound CheckBoxField:
<asp:templatefield headertext="Sel">
<itemtemplate>
<asp:checkbox runat="server" id="SelectCheckBox">
The user can check or uncheck data rows (done on the client side). The user can then perform various functions (print, view, e-mail etc.) on the checked rows. Since these functions are activated by Buttons, I can read and save the checked status of each row within the function call code. Upon return from the function, I set the checked status to where it was (I restore the status in the GridView_OnRowDataBound call). This works fine.
However, each data row also has a separate HyperLinkField. The problem I have is when the HyperLink is clicked, I can't read the checked status of the rows so that I can later restore them. It looks like the GridView is destroyed prior to the HyperLink transfer.
Any suggestions?
Jim
|
|
|
|
|
in my project i have a class which has some shared methods and ENUMs. Its work when developing but at web servwer it doesnt. that class stands in APP_CODE folder.
What ca i do?
|
|
|
|
|
greekius@hotmail.com wrote:
but at web servwer it doesnt. that class stands in APP_CODE folder.
What error you are getting ? ASP.NET treats APP_CODE as a single assembly. Post sample code where you are getting error.
|
|
|
|
|
Hi,
I'm having a problem selecting records from my database to display on the web page. I want to select all records with a specific name, and on a specific date. The code I'm using looks like this:
<br />
StrConnect = Server.MapPath("./MyDataBase.mdb")<br />
cn = Server.CreateObject("ADODB.Connection")<br />
cn.Open("PROVIDER=MICROSOFT.JET.OLEDB.4.0;Data Source =" & StrConnect)<br />
rs = Server.CreateObject("ADODB.Recordset")<br />
rs.Open("SELECT * FROM TheLog WHERE name='123' AND recdate=#01/02/2003#", cn, 3)<br />
Now despite there being about 5 records with that name and date, I don't get any records returned.
Does anyone know why?
P.S. The database is a Access database, the name field is set to "Text" and the recdate field is set to "Date/Time"
- Munty
|
|
|
|
|
Try using a range of dates (eg. between 01/02/2003 00:00:00 and 01/02/2003 23:59:59, don't use my syntax ) rather than specifying recdate to be exactly equal to 01/02/2003
_______________________________________________________________________
http://www.readytogiveup.com/[ ^]
"you can't forget something you never knew..." M. Du Toit
|
|
|
|
|
Nope, didn't work.
:/
The string I used was:
SELECT * FROM TheLog WHERE name='123' AND recdate BETWEEN #01/02/2003 00:00:00# AND #01/02/2003 23:59:59#
Also,just to note, when I ouput the date field to a text box, I get:
01/02/2003
- Munty
|
|
|
|
|
name is reserved word in TSQL
Muntyness wrote: WHERE name='123'
and you try this
"SELECT * FROM TheLog WHERE [name]='123' AND recdate=#01/02/2003#"
I Love SQL
|
|
|
|
|
Name is reserved? Bah.
Well I've changed the field to Job now. and I've tried both:
"SELECT * FROM TheLog WHERE job='123' AND recdate=#01/02/2003#"
And
"SELECT * FROM TheLog WHERE [job]='123' AND recdate=#01/02/2003#"
Neither of them work.
This does work however:
"SELECT * FROM TheLog WHERE job='123'"
- Munty
|
|
|
|
|
Hi,
This may be a stupid question, but I'm having troubles assigning a hex value to the backcolor of a table cell with code.
I'm currently adding values into a table with code, but I would like to change the back color by giving the color's hex code or #code.
In the visual designer I can easily add the hex code, why not with code or am I forced to split it into blue, red and green or just use the basic system.drawing.color choices?
Hope someone can help
Kind regards
|
|
|
|
|
You create a Color value using the FromArgb method:
SomeTableCell.BackColor = Color.FromArgb(0xffff00); // yellow
or
SomeTableCell.BackColor = Color.FromArgb(0x80, 0x80, 0x80); // grey
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you, it works.
I just had to use '&H' instead of '0x' for VB.
But it works great, thank you for the help
|
|
|
|