|
Yeah one option would be to have two textboxes on the page. Then change the Style.Display property to show one or the other which can be done easily with Javascript.
I didn't get any requirements for the signature
|
|
|
|
|
hi dear friend's
oh my god
im alone and alone
and nobody close me
no body know me
nobosy love me
nobody like me
but i have u
you like me
u love me
u power me
and u are all of my things...
thank u
|
|
|
|
|
Bad poetry certainly does NOT belong in a programming forum.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
He must be a Vogon.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Hi all,
I'm trying to load a user control dynamically into a web form. As I understand it, in order for the Placeholder to have a viewstate, I need to load the control in it before the Page load. So I'm trying to do that in the OnPreLoad method.
I have a link button on the web form. When I click it, I would like to load the user control in the placeholder. The first thing I do is save the UniqueID of the link button in the session. Now in order to be able to check which control has triggered the postback, I match the saved value in the session with the value of this.Request.Form["__EVENTTARGET"] . If they are equal, I go ahead and load the control.
Now the issues I'm having:
First, when the page loads for the first time, I have a javascript error that says
'null' is null or not an object
The page continues to work however and when I click the link button, the user control is loaded and is displayed.
Now I have a button in the user control, when I click it, the user control disappears again on postback. I'm guessing this is because the placeholder didn't hold the viewstate as I expected. Would that be due to that Javascript error? The code I'm using is this:
if (this.Request.Form["__EVENTTARGET"] == (string)Session["linkID"])
{
uc = (UserControl)Page.LoadControl("modules/AddFeatureType.ascx");
PH_AddFeature_AddType.Controls.Add(uc);
}
where uc is declared globally in the page class.
When I remove this code, no javascript error anymore.
So my questions are: 1-Has anyone encountered a similar javascript problem and if yes, what is causing it exactly? 2-Is OnPreLoad the correct method to place the user control load process to maintain viewstate during postbacks?
Any other insights or issues concerning dynamic user control loading are welcome and appreciated.
Thanks.
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"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."
--Rich Cook
|
|
|
|
|
Ok I found the problem. In the beginning I was loading the user control statically in the web form and then when I wanted to try to load it dynamically, I commented the line where I call it.
<td>
<asp:PlaceHolder ID="PH_AddFeature_AddType" runat="server"></asp:PlaceHolder>
<!-- <aft1:AddFeatureType ID="AddFeatureType" runat="server" />-->
</td>
This resulted in the comment tags to appear in the html code, I have no idea why actually. Anyway, I removed the comment completely and now the page loads without javascript errors and when i click the button in the user control, the required field validator of my textbox works.
Now I have another issue related to the field validators, I'm not sure if I should created a new thread for it or not.
In that same page with the user control, I have 1 textbox in the webform and 1 textbox in the user control, both have required field validators attached to them. I also have two buttons, one in the web form and one in the user control.
My problem is that when i click the button inside the user control, the field validator of the textbox located in the web form activates. My question: is there a way to have some kind of scope for the button? I would like only the field validator of the user control to activate when i click the button inside the user control. Is there a way to accomplish such a thing?
Thanks.
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"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."
--Rich Cook
|
|
|
|
|
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
|
|
|
|