|
.NET Enthusiast wrote: I have an asp:Panel and then I populated it (as shown) in the code behond. Ideally I would like to populate a div the same way.
How are you populating the panel? Where is the code you mentioned? What I am suggesting is for you to use a div insetad of a panel to design your page layout.Now for displaying data, you can put a control like a repeater or a grid etc. in the Div and simply bind it.Anyways post your code so we can help.
|
|
|
|
|
You're not getting the point!!!
I mentioned I have a panel. And I populate it just fine. There is nothing wrong with the code behind. What I am tying to say is... The container controls display differently in different browsers. Now it doesn't matter what server control I use, I don't want tables. You understand?
|
|
|
|
|
Bassam Saoud wrote: I dont think you can populate a div with data
Not with "data", but surely with text or controls.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi,
I need to know how I do some thing..
I have FormView in my page and this form is in editMode and have a button ( save ) to save any information changed in FormView
my problem is :
I want to appear a message when the user want to go out without pressing on the save button For example : I have a FormView with edit mode , the user write some thing in this formview and don’t press the save button , then he want to return back to the main page by any button ( back or any other page link ),, here I want to appear this message .. " do you want to save this information " ??
With three choices " yes , no, cancel"
When he press on 'yes' I want to call SqlDatSource.update() to update information And when he press on 'No' I call SqlDataSource.cancel()And when press on 'cancel ' I return to the same page without any event .. How I can do it ??
|
|
|
|
|
hi
you can use a showdialog and show custom form that have these buttons and then perform your program depend on the result of show dialog
sepel
|
|
|
|
|
Thanks for your reply ..
But how I can found show dialog ?? or show custom form ? are these in java script ?
Sorry for my question but because I am beginner in asp.net
Thaanks
|
|
|
|
|
you must add some javascript to onclient click of your buttons.
then in them call showDialog of javascript you need some parameter to return value of dialog result.
function ProductDialog(){
var mytext;
var myvalue;
}
function myShowDialog()
{
ProductDialog.mytext="";
ProductDialog.myvalue="";
if(window.showModalDialog('../Choose.aspx' ,ProductDialog,"dialogHeight:570px;dialogWidth:440px;Scrollbar=1") == true )
{
//do some thing
}
else
{
return;
}
}
in your buttons add this
onclientclick="if (myShowDialog()) return true; return false;"
in form that you showed it
write javascript to access dialog result
window.dialogArguments.mytext = s;
window.dialogArguments.myvalue = node.Value;
sepel
|
|
|
|
|
when we use this overload of fill method od sqldataadapter:
SqlDataAdapter.Fill(DataSet,StratRecord,MaxRecord,TableName)
Imagine we have 1,000,000 record and we want to retrive 20 record from 100 to 120.
we know that DataAdapter itself use DataReader. I want to konw this Fill method retrive only 20 record and return result or retrive 1,000,000 record and thern return 20 of them ?
it is so heavy if retrive all result and return 20 of them.
please guide me. because I want to use this method to paging.
|
|
|
|
|
First of all, you should never implement paging like this. It is incredibly wasteful and inefficient to fetch 1 million records from your database and then discard all but 20 of them. Paging logic should be implemented in a stored procedure so that only the specific page of records you want is returned to your application.
If you are using SQL Server 2005, the ROW_NUMBER function can assist you with paging records. Have a look at this article[^].
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
|
Hi all,
I have a Gridview within a loginview control, and for some reason I receive the error in the subject line the moment that I click on the edit button of the gridview when I set the property of the gridview AutoGenerateEditButton=true.
Is this because of the Gridview being within another control?
*Modified*
Also, I set the datasource in the codebehind. Basically gridview1.DataSource = new Class().MethodThatComunicatesWithSQL();
gridview1.DataBind();
Might this be the issue?
Any advise or pointers will be greatly appreciated.
Thanks in advance
No matter how long he who laughs last laughs, he who laughs first has a head start!
modified on Saturday, December 15, 2007 1:29:05 PM
|
|
|
|
|
The error means what it says, all those 'auto' methods require you to generate a method in the code behind. Google it and you'll find docs on what the method needs to do.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I did that, and that resolved the error that I received, in the method I have the following :
protected void EditRow(object sender, GridViewEditEventArgs e)
{
try
{
GridView grid = (GridView)LoginView1.FindControl("GridView1");
grid.EditIndex = e.NewEditIndex;
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
But I have to click on the edit button of the GridView twice before I'm able to change the values, is there a way that I can force the page to make another trip to the server?
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Is anyone else in this boat or am I the only one? I'd like to create a custom Membership Provider, but everytime I get to a certain point in the design, the way MS has implemented everything really limits what you can do! It would have been a 1000 times better if they'd just made all the Membership stuff Interfaces instead of hard classes which they completely designed around their own database and then said "Oh, here's a pattern". Who's pattern? Not mine. Don't think that I am a n00b trying to use Membership for the first time. I've been using and studying it for over a year and a half now.
I'm at the point now where I'd rather just implement the Membership classes from scratch and I'm wondering if anyone else out there has seen anything to this matter.
|
|
|
|
|
Hey guys
I have a very simple question and need a simple solution to it
My GridView Pager is something like...
1 2 3 4 ...
I want it this way...
Page: 1 2 3 4 ...
I know its possible in custom paging or adding some code in code behind. But I need to have it have it without changing code of project, if you help me out. thanks
|
|
|
|
|
Please try with the CSS and display it in the front end. I hope that is one of the way.
Otherwise try to use object datasource and in the custom paging code it as to display page in the fron tend.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Hello every one,
I'm working in a Wizard Control and on one of its WizardSteps I'm adding the link buttons in an ASP:Table control. The code is like this
<code>
{
TableRow tr = new TableRow();
TableCell td = new TableCell();
for (i = 0; i < oCat.DefaultView.Table.Rows.Count; i++)
{
if (i % t_col == 0)
{
tr = new TableRow();
CategoryTable.Rows.Add(tr);
}
LinkButton link = new LinkButton();
DataRow dr = oCat.DefaultView.Table.Rows[i];
link.Click += new EventHandler(linkPrimaryCategory_Click);
link.ID = oCat.ID.ToString();
link.Text = oCat.CatName;
td.Controls.Add(link);
tr.Cells.Add(td);
td = new TableCell();
oCat.MoveNext();
}
}</code>
my problem is that the list is being generated but the event handler I'm trying to add to the link button (shown in bold) isnt working. While debugging it doesnt go to that function at all. So what should I do?? Please give me ur suggestions, comments etc.
Thanks in advance
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
when you click on the Link button, and the page postbacks, does the button disappear,i.e are you loosing all the dynamically created controls at postback ? If so , you'll need to recreate the controls at each postback and that will solve your problem.
|
|
|
|
|
oh yes that's exactly what's happening. I loose the whole set of rows in the table.
Thanks
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
yeah, I faced the same problem once, I remember solving it by recreating the controls.
|
|
|
|
|
sorry there's another problem here. This table is in a WizardStep and I want to go to the next WizardStep when the user clicks the link. What this thing is doin right now is that it doesnt go to the next wizardstep
her's the code in the Page's load event
<code>if (IsPostBack)
{
int pid;
if (Request.QueryString["p_id"] != null && Int32.TryParse(Request.QueryString["p_id"].ToString(), out pid))
{
if (Wizard1.ActiveStep.Title.ToLower() == "select a category")
{
PCatIDHiddenField.Value = pid.ToString();
Wizard1.ActiveStepIndex = 2;
}
}
}</code>
The problem I see is that the Hyperlinks call the page all over again and it's not taken as a postBack so the wizard gets back to the start screen and I get no juice. Previosuly I tried to put a link button and register its Onclick event dynamically but that didnt work at all. Currently it looks like I'm preety much out of ideas except that I should let the idea of using a wizard go and make seperate forms that should work like a wizard.
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
I am not sure whats going on , but I just compiled a sample project and it worked:
I've created a create button function:
Private Sub CreateButton()
Dim oButton As LinkButton = New LinkButton()
oButton.Text = "My Button"
AddHandler oButton.Click, AddressOf Buttonclick
Dim oPlaceHoder As PlaceHolder = CType(Wizard1.FindControl("PlaceHolder1"), PlaceHolder)
oPlaceHoder.Controls.Add(oButton)
End Sub
I hooked the Click Event to this function:
Private Sub Buttonclick(ByVal sender As Object, ByVal e As EventArgs)
Label1.Text = "Button Clicked"
Wizard1.ActiveStepIndex = Wizard1.ActiveStepIndex + 1
End Sub
I am calling the CreateButton function on each page Load
<br />
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
CreateButton()<br />
End Sub<br />
Also Note that I am using a placeholder to hold the dynamically created button.And sorry for providing a VB.NET sample, I don not have C# installed on this PC.
|
|
|
|
|
YES Finally it worked!!
Thanks a bundle, I really appreciate ur help,
well I did as u were doin I had replaced the Linkbutton with hyperlinks while trying all sorts of things and now it has moved to teh next WizardStep and this one is now turning out to be empty, so I'm looking into that matter.
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
Can somebody help in hosting an ASP.Net website in IIS
Thanks in advance
|
|
|
|
|
What kind of help are you looking for?
|
|
|
|