|
Viewstate in dynamically created controls is always a nightmare. The easiest way to handle it, is to write some JS that writes to a hidden control, with the text of the textboxes, and then you recreate them from there. The hidden control is always defined, so there are no viewstate issues.
Failing that, I wonder why you're creating your own 'child control list'. Why not just iterate over the controls collection that you're adding to, the one that already exists ? You can create a list that iterates over the controls list and only returns controls of a particular type. I bet if you set breakpoints, your problem is with the order of operations, and that childcontrollist getting set to empty.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Christian Graus wrote: Viewstate in dynamically created controls is always a nightmare. The easiest way to handle it, is to write some JS that writes to a hidden control, with the text of the textboxes, and then you recreate them from there. The hidden control is always defined, so there are no viewstate issues.
|
|
|
|
|
thanks so much for the reply, and i will post this in a new thread as well.
so my next question is.
Can you give me a quick example of how to do this? Take the text from an asp.net control and adding it to a hidden field via javascript?
that would help me a lot!!
Thanks.
|
|
|
|
|
What is the best way to check for a record exists in a database using linq to sql?
I want to check if a userid (int) and typeid (int) exist. - The following code always returns zero even if the record exists - what is the best approach?
int result = 0
result = (from t in context.customers
where ((t.userid == intUserID) && (t.typeid == intTypeID))
select t).Count();
|
|
|
|
|
Why do you need Linq to SQL for such a basic task ?
This is what I feared, new tools are being forced like square pegs into round holes by people with no idea. And, this is a SQL question. A very basic one, at that.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
I am having a pretty weird problems with my custom web controls. basically to start it all, I have a custom web user control, written in C# as a Class inherit as User Control. What it does is like a bread crumbs approach control, if you guys are familiar. I am using a modal pop up extender, a grid pops up then with a separate data pager, when the grid fires selectedIndexchange event then just basically append a dynamic link button into the placeholder with added event onclick to basically just remove it self from the placeholder if clicked.
now my problems are.
1. when I get to the last item in the place holder, the onclick event won't fire, it hides itself from the users view, and shows itself back when another link button is added into the placeholder and that's not all, in debug mode there is no event that can capture all those what's happening in that linkbutton when i clicked it, it just hides and yes even javascript on click event can't capture it.
2. datapager in the pop up goes haywire when i click the next button, it hides.
I am aware that this might be a problem on how I render the control, but even if I tried this approach in an actual web page and not as a usercontrol I still get the same problems aside from the datapager.
I am not trying to find a solution cause this is a really hard problem believe me, if there is then I would welcome it. I just wanted to know if anyone has the same experience? thanks.
|
|
|
|
|
I have an editable gridview with blank cells. User enters some numeric data in cells & clicks a button. My problem is that, as soon as button click event is fired, the page refreshes & the gridview becomes empty. Can anybody tell me, how can I save values in cache so that button click event does not result in loss of data. ?
|
|
|
|
|
Surely the point of the button is to store the values ? Where do the values get stored in general ? I'd expect the button to store the values in the DB and then the control to rebind to the data source.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
my database Ms Access has 3 fields as folllows;
id- number
imageName- text
imageURL- text
...................................................
I have a fileupload tool and a button names btnUpload which helps to upload images to a folder and that path gets saved in database field names imageURL.
.........................................................
Inherits System.Web.UI.Page
Dim constr As String = "Provider=Microsoft.jet.OLEDB.4.0; Data Source=D:\imgupload\db1.mdb;Persist Security Info=False;"
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
If FileUpload1.HasFile Then
FileUpload1.SaveAs(IO.Path.Combine(Server.MapPath("Image"), FileUpload1.FileName))
fnSaveFile(IO.Path.GetFileName(FileUpload1.FileName), IO.Path.Combine(Server.MapPath("Image"), FileUpload1.FileName))
End If
End Sub
Public Sub fnSaveFile(ByVal FileName As String, ByVal FileURL As String)
Dim cmd As New OleDb.OleDbCommand
Dim con As New OleDb.OleDbConnection(constr)
Try
Dim strSql As String = "insert into tbl_Image(ImageName,ImageURL) values('" & FileName & "','" & FileURL & "')"
'------------"
con.Open()
cmd.Connection = con
cmd.CommandText = strSql
cmd.ExecuteNonQuery()
Catch ex As Exception
Response.Write(ex.Message)
Finally
cmd.Dispose()
con.Dispose()
End Try
End Sub
................................................................
my image uploading is working well. cud anyone sugesst me a way to add a gridview and show the image other than showing the path of the image.
|
|
|
|
|
Did you gone through the all the reply that was provided to you in your last post?
|
|
|
|
|
ya but I didnt understand or get any idea to change those to my requirement. plz help me
|
|
|
|
|
Pratheepa wrote: ya but I didnt understand or get any idea to change those to my requirement. plz help me
Well, posting the same question again, will get you the same answers. The problem is that you're not capable of doing this task. If this is homework, talk to your teacher. If this is paid work, tell your client that you are a fraud now, and save you and them further time and hassle. We answered you. If you can't understand it, that's not our fault.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Pratheepa wrote: ya but I didnt understand or get any idea to change those to my requirement.
|
|
|
|
|
If im understanding right then just put this in ur gridview on ur aspx page:
<img src='<%# DataBinder.Eval(Container.DataItem, "imageURL") %>' alt='<%# DataBinder.Eval(Container.DataItem, "imageURL") %>' />
|
|
|
|
|
thanks a lot. it really works.
|
|
|
|
|
please
i need a help on this
the chess game can have drag and drop interactivity for players to
make moves. Players can also nominate to play against one of a number
of chess engine, and also play an online friend and also play against the adminstrator
|
|
|
|
|
|
We mocked you to scorn the last time you asked this. In the time between, have you done anything to try to do your own project, or have you been begging other forums to do your work for you ?
I assume this is a school assignment. If you get the code from the web, how does that help you learn ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hi! I am currently creating a master page with a sidebar but I want the height of the sidebar to adjust by itself depending on the size of the page. The reason for this is that I am planning to place an background image on the sidebar so that it would always be visible throughout the page no matter how long the contents may be. What I am trying to achieve is similar to the sidebar of this(codeproject.com) website where the height of the sidebar(and its background) depends on the size of the contents of the page. Can anyone please help me with this? Thank you.
Regards,
Boggs
|
|
|
|
|
boggs wrote: What I am trying to achieve is similar to the sidebar of this(codeproject.com) website where the height of the sidebar(and its background) depends on the size of the contents of the page.
Use table, put content inside the table. Don't fix the height of the table. let it be depends on your content.
|
|
|
|
|
Okay... I'll try that. Thank you very much...
|
|
|
|
|
welcome! let me know if any other issue.
Thank you.
|
|
|
|
|
can't see automatic generated code (Cs file) for Dataset object .
any help
|
|
|
|
|
To see the autogenerated code
Select the project and click the "Show all files" option at the top of the solution explorer, then expand the dataset in the solution explorer
Any changes you make to that code will be overwritten if you chnge something in the dataset
Instead you should use a partial class
Alexei Rodriguez
|
|
|
|
|
Hola Rodriguez .
I don't find any Show all files icon in the Solution Explorer tab ,
I only have ( from left to right)
-properties
-refresh
-nest related files
-view class diagram
-copy website
-asp .net configuration
I even tried what i found in a forum about this problem :
Tools/import and export settings / reset all settings
Still doesn't work ..any suggestions ?
|
|
|
|