|
I am using vb.net with this datalist, as the code behind. I have found in the past that datalist, dataGrid and repeater are simular, if you could show me what you do with repeater maybe I can figure out what to do for the datalist... I do all sorts of modifications of attributes in the itemdatabound event, lsts add another.
Thanks...
|
|
|
|
|
The point is that with a repeater, you write out the HTML that is emitted verbatim, so you can build a table and set the td/tr tags to contain ids if you want. I don't think the datalist will let you, I think the itemdatabound event is your best bet
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
The problem is I don't know what you mean by a row tag, is that like the index of the row. Because the ItemCommand event gives me the e.item.index of the row that I am on, me.datalist1.Items(e.item.index) at this point there is something called UniqueID is that what I want. How do I pass it to the javascript. There is also a .Focus() method here how does that work? Thanks for all your assistance...
Chuck...
|
|
|
|
|
If you look at the source code of your actual page, those controls are all building an HTML table. You want to focus on a row, so you need to be able to select that row. The tr or td tag in question.
If it has an id, the ClientID is the property you want. Then you can emit some js that passes the ClientID ( which you generate on the server ), to a method which takes that id, and selects the object and focuses on it
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I think you have helped me a great deal more than you may know.
I found an example of some microsoft stuff that might work. I'll get back to you later and let you know the results..
Thanks for all your help..
Chuck
|
|
|
|
|
I have a datalist that contains textboxes in the columns.
I have TabIndex set for every dataentry field on the page.
I have set TabIndex="121", on the first field TabIndex="122", on the second and so on.
The when tabbing the tabs go down the first column, then the second column and so forth.
So I changed all of the TabIndexes to TabIndex=121.
They still go down each column.
I need the tabs to go across all columns of the row before moving down to the next row.
How can I get the tabs to move across all columns in a row before moving down to the next row.
Can anyone give me "direction" and maybe a code snippet?
Thanks..
|
|
|
|
|
Making them all the same will not do it, you need to sequence them in the direction you want to go.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
As I stated in the explaination setting originally to tabindex="121", 122, 123 and so on in the datalist asp code did not work.
|
|
|
|
|
Hi...
I think it should take it automatically.....
If it is the case than you set one global variable and in ItemDataBound just get object of each and every control & u can set tab index=global_variable value for this controlobject. after setting tabindex just increase the global variable value to 1.
|
|
|
|
|
This is a great solution..
Worked perfect the first time...
Thanks..
|
|
|
|
|
Good evening.
In many places in my web application i use the asp:ImageButton control.
However ASP.NET interpreters it as for example:
<input type="image" src="Images/Edit.gif" onclick="javascript:__doPostBack('....','Edit$0')" style="border-width:0px;" />
And always Firefox asks me if i want to remember the password.
However in most cases the image button is not used for password submit.
Am i using ImageButton incorrectly?
How can i fix that problem ?
Regards, Hris
|
|
|
|
|
You can't change what ASP.NET renders, unless you write your own image button control.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
I don't think that the issue is your button, actually, I think it's other controls on your form. You'd have to experiment to find out. I think that this line of questioning in Firefox is new, and so there's a collision. The FF people either didn't test it, or didn't care that it doesn't work nicely with ASP.NET sites.
The alternative is that you have some sort of password text box on your form, for whatever reason, and that's the cause.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello
Im must read records from Gridview and then insert them to database.
Here is the code that I wrote.
<br />
for (int i = 0; i<counter; i++) <br />
{<br />
string ID = GridView.Rows[i].Cells[0].Text;<br />
objDataAdapter.SelectCommand.CommandText = "INSERT INTO MYTable " +<br />
"(Name) VALUES(@Name)";<br />
objDataAdapter.SelectCommand.Parameters.AddWithValue("@Name",Name);<br />
}<br />
There is an exception:
The variable name '@Name' has already been declared. Variable names must be unique within a query batch or stored procedure.
Please help me how can I handle this exception.
|
|
|
|
|
Does this happen the first time through, or the second ?
Why would you make the 'select command' do an insert ? Why not just run the SQL directly without using a data adapter ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
The problem solved with this:
objDataAdapter1.SelectCommand.Parameters.Clear();
|
|
|
|
|
OK, that's what I suspected, because it's a member object, you're setting the parameter over and over, that's why I asked if it happens the first time.
I think those data adapter things are retarded, I never use them.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I think those data adapter things are retarded, I never use them.
What do you use instead of adapter?
|
|
|
|
|
I write a proper data layer, in a seperate dll, I NEVER put SQL in the presentation layer, and I'd fire anyone who worked for me who did.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi ...
I have bind one gridview with 2 different Method.
Total 250 records are there.
In first Method I fetch all 250 record in dataset and bind in Gridview with EnablePaging = True. Mean while i am saving this dataset in view state.Here grid view show only 10 records per page.
So now when i see page source it display size of view state around 28 kb.
In second method I fetch page wise record from DB. Means for 1st page i am fetching 10 record. and storing this dataset(with only 10 records) in view state for sorting.
Now when i see page source it display the same size in view state.
Is there any other technic to reduce view state??
and why happen like this in first method it fetch 250 records and i am storing it in view state while in second method i fetch only 10 records and storing in view state still view state size remain same.
|
|
|
|
|
Hard to say without seeing the code. What happens if you disable viewstate in the gridview, how much does it drop by then ? That will tell you how much of the viewstate is your data in the gridview
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi christian,
i have already disable view state for some of the column in grid view.
After binding gridview i am reading one by one row and each and every row i am go thorugh cells one by one and disable this cells enableviewState property to false.
in this way if i am doing than it is reduce viewstate from 32kb to 27 kb.
but problem is that first method fetch 250 records and i am storing this records in viewstate for later paging & sorting
& in second method i am fetch first 10 records and storing this record in view state for later sorting only. when i click second number in paging than i am fetching record from 11 to 20 and storing this one to view state.
just my problem is to when i see view source of aspx page at that time in both the case it showing me viewstate size as 27 kb only.why it is not reduced...???? In first case i have store 250 rows while in second one i have stored 10 rows in view state..
Regards,
Hemant Patel.
|
|
|
|
|
Asking me the same question again is not helpful. Did you disable viewstate for the entire grid ? If you did, then any viewstate you're seeing, is from other things on your page.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello I am trying to create linkbutton controls that are supposed to fire method. I add them to pageload however I am told that I should add them before it. I google the lifecycle and I found 2 events Init and PreLoad, I tried them and they are really fired before page_load however this time the controls even do not appear. here is the code:
protected void Page_Preload()
{
for (int i = 1; i <= 2; i++)
{
LinkButton bottomLink = new LinkButton();
LiteralControl bottomLiteral = new LiteralControl(" ");
bottomLink.Text = i.ToString();
pnlBottom.Controls.Add(bottomLink);
pnlBottom.Controls.Add(bottomLiteral);
bottomLink.OnClientClick += new EventHandler(this.changeLink);
}
}
it is drawing me crazy please help.
|
|
|
|