|
thanks.
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hi all,
my problem is in previous ASP.NET (VS 2003) writing a
function that grabs a string value from a textbox is as easy as:
dim str as string = me.TextBox1.Text
but with visual studio 2005 I can't do this simple way because the class for
that form is placed in the app_code folder and it will not see non of the
web controls on the web form, so saying:
dim str as string = me.TextBox1.Text will not work and it complains about
the TextBox1 is not defined. in more details, I have a function was working
in visual studio 2003 that calls a stored procedure in sql server 2005, this
function passes a variables (3 variables) from a 3 textboxes on the form.
And I am calling this function everytime the user changes the value of one
of these textboxes.
now since the migration, visual studio 2005 puts all classes under App_Code
folder (as one of their new features!!) moving my function under the
App_Code folder prevents me from calling/Getting the values of those
textboxes as they change why? because the class can't see those controls
sitting on the form!
I am going crazy with this. Does anyone know?
thanks for your help.
|
|
|
|
|
Just use the code behind page. When you add a web form make sure you check the 'Place code in separate file' checkbox then there should be a little plus sign next to the .aspx page, when you expand it you'll see a .aspx.cs (or .aspx.vb depending on language) file where you can do all you work with the controls. app_code is for more universal code like business logic (though I normally make another project in the solution for this), server controls, or help classes.
|
|
|
|
|
thanks eggsovereasy for your reply,
this is a very good news, because i was chatting with some guys and they told me that i HAVE to follow the new format (App_Code) and the old VS 2003 is being discontinued and it would increase performance or something like that. anything true to that?
plus, do u have any idea if a project has already been migrated and(all classes being moved to the App_Code folder), if there is a way to move all those classes back behinde their forms? or i have very much to re-migrate?
-- I just did a re-migration and there is no option or checkbox to force visual studio to use code behinde page! any idea?
thanks a lot
-- modified at 12:04 Thursday 18th January, 2007
|
|
|
|
|
Hi,
I want to fill default white backround color inside the asp.net checkbox to some different color (e.g. gray) but none of the properties exposed by asp.net checkbox control seems me to do that. does anybody have any idea about how to achieve this.
Regards,
Amit
|
|
|
|
|
This makes it gray for me:
<asp:CheckBox id="cb1" runat="server"
BackColor="#CCCCCC"
Text="My Checkbox"
/>
|
|
|
|
|
Mike,
I was asking to fill the checkbox with gray color and not the outside area of the checkbox.
Regards,
Amit
|
|
|
|
|
Oh. I see. I don't think you can do that, even with CSS. The solutions I have seen have resorted to using javascript to swap images between a "checked" state and "unchecked" state, using a colored box as for the images.
|
|
|
|
|
Hi all,
I have been working on a "web interface" project but I am unable to get it working. Here is what I want to implement. I have been trying to bind the 5 Listbox controls to a single Repeator Control. I have populated the 5 Listbox controls from the underlying database tables. Whenever the user selects values from each listbox controls the result should be displayed in the Repeater control. I can bind one listbox to the Repeater but I can't bind all five listboxes at the same time.
Looking forward to your reply
Thanks for your help,
Koonda
|
|
|
|
|
You can bind your repeater to an ObjectDataSource control, which is configured to use a method that takes 5 parameters. Then use ControlParameter controls within the ObjectDataSource, each configured to pull a value from one of the listboxes. Use AutoPostBack=true on each listbox so that a change in any will trigger a postback, refresh the ObjectDataSource, and redisplay data in your repeater.
That's one way to do it.
|
|
|
|
|
Thanks Mike Elison,
But I need some code examples. I am not using any code to get this project done. I am just draging the Listbox controls and a Single Repeater. I just change some html in the aspx file for the Repeater Control to get the values. Could you please send me some code to bind all the 5 Listbox Controls to the single Repeater Control to display information to the user
I realy appreciate your help.
Thanks
Koonda
|
|
|
|
|
koonda007 wrote: But I need some code examples. I am not using any code to get this project done. I am just draging the Listbox controls and a Single Repeater. I just change some html in the aspx file for the Repeater Control to get the values. Could you please send me some code to bind all the 5 Listbox Controls to the single Repeater Control to display information to the user
Nope. Databinding to a control like the Repeater is such a ubiquitous task - you need to understand it if you're going to get anywhere as an ASP.NET developer working with data. You need to look into the ASP.NET tutorials at:
http://www.asp.net/learn/default.aspx?tabid=63[^]
- the data tutorial particularly. And you'll want to look into MSDN documentation[^] on the topic.
I tell you what... look over all the material on those links. If you still have questions on displaying data in your Repeater (using values from 5 controls as parameters) post your question again.
|
|
|
|
|
Thank you very much for the links. In your 18th January reply I was confused with some terms, such as you said use the ControlParameter controls. What do you mean by that. Do you mean the ListBox control parameters or the Repeater control Parameters. Please also tell me is there any way to do that without coding?
Thanks
Koonda
|
|
|
|
|
Koonda -
I can't tell if I am misunderstanding your purpose or not at this point. Let me start over and ask some yes/no questions:
1. Do you have data that you want to be displayed through a Repeater control?
2. If so, are you using the five list boxes as parameters for that data? In other words, the selected values from each of the five will filter the data to be displayed in the Repeater?
If the answer to either of these questions is "no", then I've completely misunderstood your intention.
|
|
|
|
|
Hi all
I have an update form to update users data(name, fullname, password), when you select a user to update from the dropdown list, you can view his data, but the password is not viewed in its password control...
The problem is in the control itself, and not is getting data from the database,
I use these statements:
Text1.Value = dr.GetString(1) 'It works
Password1.Value = dr.GetString(2) ' it does not work
Reagrds...
Nour Abdel-Salam
|
|
|
|
|
It's 0 based, you know that, right ? Apart from that, if you're not getting it from the DB, you need to look at your SQL code, obviously
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Dear...
I didn't stand what do you mean by 0 based, and here is my sql:
cm.CommandText = "select * From users where u_id = " & DropDownList1.SelectedValue & " "
dr = cm.ExecuteReader()
If dr.Read = True Then
Text1.Value = dr.GetString(1)
Password1.Value = dr.GetString(2)
end if
waiting from you soon
and regards
|
|
|
|
|
nour123 wrote: I didn't stand what do you mean by 0 based
IT's VB, so I may be wrong. In C#, the first item in the list is number 0, not number 1.
The debugger will tell you what's coming back. Select * has the distinct disadvantage of not telling you how many items will be selected per row.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
hi,
I have deployed a .msi on the server and it has been installed very well. But now the problem is that when I try to run it I get this error:
The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Why could this be happening?
Thanks
|
|
|
|
|
Sir,
I have created a windows forms control in which I put a DSO Framer control. I have compiled it and registered in GAC. Even its doing fine when I used it in another windows application. But When I try to put it in a web page its not showing anything as it is the same thing showing the required word doc in windows application.
Please tell me what are the steps do I need to take to make it fine. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
This has turned into a nightmare for you, hasn't it ?
Can you add some code to catch errors and so on, at the top level of your control, and see what that turns up ? I think it's a permissions problem, I always said this would bite you.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
nightmare?
Its human nature and being a s/w emp is not an exception. While some one is sad, other feel funny or even happy too. What can I do, many great people have come to change it, still only a part is changed. Am I right Christian?
Could you please tell me Whats the exact meaning of Christian(dont feel otherwise I want to know it), I respect it actually. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
May be, but I have even changed security settings too. Still its not working. I dont take any thing as nightmare. One day we die, we all know about that. But every one is facing it. This problem w'nt be greater the that, so we can face it easily. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
So, it means that I dont have any other option to get it done. Even I am also fedup Christian. I am also tired by trying it out, but my client is considering as it is my fault only. He is not believing it. He is assuming that I dont know that.
This is very bad, I am feeling Christian. I feel very bad that I couldnt do it. I am about leave this for myself. Thank you for understanding and replying for my queries politely. Thank you very much. Ok. Take care.
Bye.
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
indian143 wrote: So, it means that I dont have any other option to get it done
Well, put it this way. The bulk of the answers you've got, have been from me, and I've been telling you from before you started that this was not the way to go. So, yes, you need to explore another option, even if it's another way to get info on how to make this work. At a minimum, it seems that no-one here has any better advice to offer. And like I said, without looking at your code, I don't see how your question can be answered.
indian143 wrote: but my client is considering as it is my fault only.
Well, in some ways, it is. When a client asks for something that you don't know can be done, you should make it clear that you're initially offering to do paid research, not that you will find a way to do something that may not be technically possible. In the case of web dev, I would ask if they know of a site that does what they want, so you can establish if it's possible, and get something to look at to give you clues.
indian143 wrote: I feel very bad that I couldnt do it.
Yeah, I know it's tough. The most you can hope is that you've learned some things from the experience. Some things just can't be done, and most clients assume that we can do anything. That part is definately NOT your fault
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|