|
Hello!!
I am going nuts over this silly problem... has anyone come up with a solution? Maybe?
I got a master page, and a child page. The child page is accessed from the master page via a linkButton, and is set to be a modal window (so it pops up). Now, I know from the asp.net 1.1 days that I am supposed to put <base target="_self" /> between the and tags in the modal page so that it won't open another page after it posts...
My problem is, the modal window is a 'chil' page to my master, and there are no and tags. Where should I stick in the
<base target="_self" /> tag????? Thank you guys
-Nila
<grapes ::="" fun="">
|
|
|
|
|
You can place a contentplaceholder in the master page between the end head tag and the open body tag. In the content page, you can fill the base tag in a content control which associates with this contentplaceholder in the master page.
.......
</head>
<asp:contentplaceholder id="baseTagContent" runat="server">
</asp:contentplaceholder>
<body>
......
|
|
|
|
|
Thank you so much for helping me out... I am still having problems though
Now the XHTML 1.0 Transitional validation fails telling me that the needs to be nested inside <asp:content> tag, and when I do place it within the asp:Content tag, it gives me an error saying that the tag cannot be nested within . This makes no sense, I don't even have a table structure!!
Can you/anyone help me shed some light on this issue??
Thanks!
|
|
|
|
|
Placing the html tag in the Content control does not make sense to me. Here are a couple of options:
+ Just ignore the error if it's working.
+ Turn off the validation in the VS options settings (Tools|Options|Text Editor|Html|Validation|Show Errors).
+ Instead of placing the base tag in the content control, you can put the Literal control in there, and assign the base tag via the Text property of the Literal control in code.
|
|
|
|
|
When a datagrid gets populated, if the data is longer than the header text, the column is only wide enough for the data to fit. The grid lines are right up against the data making it difficult to read. is there a way to manipulate the column width at runtime adding some space between the data and grid lines?
Veeves
|
|
|
|
|
At design time you can set CellPadding and CellSpacing property of DataGrid - remember, the dataGrid renders its results in an HTML table, and these properties simply translate to those of the table.
You can set individual ciolumn widths at runtime using, for example:
DataGrid1.Columns(2).ItemStyle.Width = System.Web.UI.WebControls.Unit.Percentage(30)
This would change the third column to 30% of the overall width. You could use
...Pixel(100)
if you wanted to give it a fixed width of, say, 100 pixels instead.
cheers
Phil
|
|
|
|
|
Thanks for the response. CellPadding and CellSpacing will increase the height of the row which I don`t want. I could fix the width with percentage or pixels, but with variable length data, this method will only work sometimes.
What would be best is if there was a way to convert units to a number type and back. Then I could grab the width of a column, add some units to it and then convert it back.
Veeves
|
|
|
|
|
Hi,
I think u will have to check for ItemDataBound event of the datagrid for this purpose maybe check if u can get the current column width and then change it there only or adjust the text by inserting into the string to be bound to that column...
I haven't tried this yet...But just thought of sharing this idea...
Thanks for reading..
Thanks & regards,
Vaibhav
|
|
|
|
|
I want to fill datagrid in design view of page how to do that
|
|
|
|
|
You want to fill data in the datagrid in the design view window? Basically if you want to customize the UI of the control at design time, you can think of implementing a custom control designer, and you can read more about this in MSDN:
Design-Time Support for Web Forms[^]
|
|
|
|
|
Hi,
I have an ASP.NET application I've been developing using Visual Studio 2005 and therefore I've been using the built-in webserver for debugging. So far so good, and everything works as expected. The application includes a login page which uses the standard Login ctrl, and it uses a custom membership provider for Access (http://msdn.microsoft.com/vstudio/eula.aspx?id=96713a8e-b8d4-4d6e-bb8f-027e6c8e15d8[^]). However, when I deploy (just to the local IIS on my computer), the login stops working. I.e., when I try logging in supplying wrong username or password I get a "Invalid login" message. But if I supply a correct username and password, all I get it a "The page cannot be displayed". There is no indication of a redirect - after all, I set the Login control to just stay on the Login.aspx page after login succeedes. I've also tried to bypass the Login control, supplying my own username and password controls, and then adding the code myself which calls Membership.ValidateUser. The funny thing is, the try/catch block inside that function never catches anything, and even if my code looks like this:
if ( Membership.ValidateUser( strUsername, strPassword ) )
{
// No code in here!
}
the login *still* fails, i.e. it does not seem to matter if there is any code after the ValidateUser function call.
I honestly don't know what could be causing this but I have a feeling it could be something of the following:
- security, is someone (the membership provider) trying to write to the database and doesn't have the sufficient rights to do so? In that case, I should get an "Operation must use an updateable query" error, right?
- IIS configuration, is there something I haven't set correctly?
- something more I'm forgetting...
Anyway, I would welcome any help/ideas how to solve this!
Regards,
Daniel
|
|
|
|
|
HI Daniel. Wild guess - access permisions to write to the .mdb file, but also permissions to write to the .mdb file's containing folder. In my experience with Access databases, the aspnet_wp.exe process account needs access to read and write to the containing folder (presumably to allow the companion .ldb file to be written and updated as necessary). It's at least something to try.
|
|
|
|
|
I use AJAX in ASP.NET, in the client side code, I create a XmlHttpRequest to get data from Server(database). But when server response, how to get data from responseText or responseXML to fill in DataList or DataGrid(because DataList or DataGrid is control that run at server).
Thanks!
I sent this message in the last week, but noone answer, please help me.
|
|
|
|
|
hi,
i am sending u java script code which bind data into listbox through.
var obj
function PopulateList()
{
My.Page.ShowList(DoSetCallBack);
}
function DoSetCallBack(result)
{
if(document.Form1.ListBox1.options.length > 0)
{
document.Form1.ListBox1.options.length = 0;
}
var table = result.value.Tables.Table;
var listbox = document.getElementById("ListBox1");
if(table != null )
{
for (var i = 0; i < table.Rows.length; ++i)
{
var option = document.createElemet("option");
option.text = table.Rows[i].orderid;
option.value = option.text;
option.selected = false;
listbox.add(option);
}
}
}
|
|
|
|
|
Anyone know alot about them? I am fed up with the information being displayed as one long row that stretches away off the screen. Is there a way of making it 2 columns or even three but with the same data in it obviously.
Cheers
|
|
|
|
|
You could use TemplateColumns and put two, three, four (more?) fields worth of data in the same column.
|
|
|
|
|
Hopefully somebody can help with this or at least tell me it is possible
I have a VS 2005 project, the default page has a menu control, a multiview control and several views within this. When i click the menu item i use a case statement to make different views active, as shown;
protected void mnuMain_MenuItemClick(object sender, MenuEventArgs e)<br />
{<br />
string strMenu = "";<br />
strMenu = mnuMain.SelectedValue.ToString();<br />
<br />
try<br />
{<br />
switch (strMenu)<br />
{<br />
case "Home":<br />
MultiView1.SetActiveView(viewHome);<br />
break;<br />
<br />
case "Submit":<br />
MultiView1.SetActiveView(viewSubmit);<br />
break;<br />
<br />
case "System":<br />
ds = dba.ReturnDataSet("select * from system_status");<br />
grdSystem.DataSource = ds; grdSystem.DataBind();<br />
MultiView1.SetActiveView(viewSystem);<br />
break;<br />
<br />
default:<br />
MultiView1.SetActiveView(viewHome);<br />
break;<br />
}<br />
}<br />
catch (Exception exp)<br />
{<br />
string exception = exp.ToString().Replace("\n", "");<br />
Response.Redirect("error.aspx?error=" + exception);<br />
}<br />
}
When the user clicks the menu item 'System' i want to connect to a database using a class i created called dba and the function ReturnDataSet. I then want to bind this to a gridview control called grdSystem, which is located in the View control 'System' and make this View the active view.
This code complies and runs with no errors and the dataset has the correct number of rows returned.
But the gridview inside the View is not displayed and on walking through the gridview has no items in it. (I tested with a gridView which was not inside a view and the contents as displayed ok so i think it is something to do with refreshing the view control??)
Hopefully this makes sense and somebody can tell me if this is possible?
Thanks
Colin
-- modified at 7:19 Tuesday 18th April, 2006
|
|
|
|
|
Have you tried to place text or another simple control like Label along with the GridView in the System view and see if the active view is actually refreshed?
|
|
|
|
|
I can update the text propery of a label just after I do the bind and it shows the update.
I can also add all the items in the dataSET to a dropdownlist and it shows.
It is just the gridView which does not show the update - as if the bind has not worked.
Thanks
Colin
|
|
|
|
|
Hmm, is there any chance that the Grid control is rebound somewhere else in the web page? Here on my machine, I simply have two view with one containing a GridView control, every time I switch to that view I can see the gridview control displayed.
|
|
|
|
|
not sure what was going wrong but re-created the grid view and binding was succesfull
GridView is displayed as expected
Thanks
Colin
|
|
|
|
|
Hi
I am trying to print 2 substrings of a textbox but i get this error
MY CODE IS :
---------------
If Not TextBox1.Text = "" Then
str = TextBox1.Text.Substring(0, 3)
str1 = TextBox1.Text.Substring(3, TextBox1.Text.Length - 1)
End If
But it is giving error
-----------------------
Index and length must refer to a location within the string. Parameter name: length
Help me
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
If you look at the definition of the Substring method you will see thatthe second parameter is the length you want...not the end position.
You are trying to read from position 3 to (length-1) which will always be past the end of the string.
If you want to read everything until the end, there is an overriden version of substring method that just takes the start position.
|
|
|
|
|
Sorry i didnt get u r point sir...
How can i print that 2 values
or
any other idea to substring
thx for replying
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
If you read the documentation on Substring[^] you will see that there are 2 versions of it. One takes start position and length, the other just takes start position[^], For your str2 you want the latter. which will give you everything from start position onwards.
Also, please do not to use txtspk in these forums.
|
|
|
|