|
Me.lblShowGrid.Controls.Add(DataGrid1)
Page.Controls.Add(DataGrid1)
Because you add the grid control to the Page, so the grid and its child controls inluding the textbox will be placed outside the form element, and you will get the error. Instead, you should get reference to the form element, and add the grid to the Controls collection of the form. Another option is to place a container like Panel or PlaceHolder control in the form, and add the grid to this container.
|
|
|
|
|
I used Google Web Service to do web search, and I have already succeed to use Google Web API to do that in the same web page. But my problem is that how does the search result returned and open a new web page to show these records.
Please give me some guide. I will appreciate your teaching. Thank you.
HI!
volunteer0706@yahoo.com.tw
|
|
|
|
|
There are two options come to mind:
+ You open the new page and pass the search parameter to this page, the new page is responsible for calling the search APIs and displaying the result.
+ You use the current page to call the search APIs, then persist the result somewhere for example in the Session, and open the new page. The new page should be able to access the persisted result so that it can display on the web page.
Just some ideas.
|
|
|
|
|
Hi..
I have visual studio 2003 and I am trying to use Google Search Web Service(C#).But I got the error:
DataBinder.Eval: 'EProjects.googleapi.ResultElement' does not contain a property with the name title.
The source code of the Web Form that should display the Google Search Results:
using googleapi;
/// <summary>
/// Summary description for GoogleResults.
/// </summary>
public class GoogleResults : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.ImageButton imgPrev;
protected System.Web.UI.WebControls.ImageButton imgNext;
protected System.Web.UI.WebControls.DataList lGoogle;
public EProjects.googleapi.GoogleSearchResult gsR;
public EProjects.googleapi.GoogleSearchService gcs;
private void Page_Load(object sender, System.EventArgs e)
{
gcs=new googleapi.GoogleSearchService();
gsR=gcs.doGoogleSearch(licenceKeyString,Request.QueryString["Query"],
0, 1,true, "", true, "", "", "");
PopulatelGoogle(gsR);
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
///Required method for Designer support - do not modify
///the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void PopulatelGoogle(GoogleSearchResult gsR)
{
lGoogle.DataSource=gsR.resultElements;
lGoogle.DataBind();
}
}
}
The HTML code of the same page:
<table height="100%" width="100%">
<tr>
<td colSpan="2">
<asp:datalist id="lGoogle" runat="server">
<ItemTemplate>
<span style="font-size:17px;font-weight:bold;">
<%#DataBinder.Eval(Container.DataItem,"title")%>
</span></br>
<%#DataBinder.Eval(Container.DataItem,"snipper")%>
</br> <a href='<%#DataBinder.Eval(Container.DataItem,"URL")%>'>
<%#DataBinder.Eval(Container.DataItem,"URL")%>
</a>
</ItemTemplate>
<SeparatorTemplate>
</p>
</SeparatorTemplate>
</asp:datalist></td>
</tr>
<tr>
<td align="left"><asp:imagebutton id="imgPrev" Runat="server"></asp:imagebutton></td>
<td align="right"><asp:imagebutton id="imgNext" Runat="server"></asp:imagebutton></td>
</tr>
</table>
I tried to solve this problem for a long time but I couldnt please help.
I am too late but i will never give up
|
|
|
|
|
hi
can anybody tell the difference between configSource and file attributes in web.config file
coolsweety
|
|
|
|
|
+ The file attribute specifies an external file containing custom settings like you do in the appSettings entry of the web.config file. Meanwhile, the external file specified in the configSource attribute contains the settings for the section which you declare the configSource for. For example, if you use the configSource attribute of the pages section, then the external file will contain the settings for the pages section.
+ The custom settings declared in the external config specifified in the file attribute will be merged with the settings in the appSettings section in the web.config file. In the meanwhile, the configSource does not support merging, it means that you'll have to move the entire section settings into the external file.
|
|
|
|
|
thanx very much
coolsweety
|
|
|
|
|
Can i possible to put an infragistics control inside ajax panel
give ur suggesstions with source
-
|
|
|
|
|
What is a infragistic control?
And a please would be nice
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
hi for all
i need to know how debug in aspx javascript and see what happend in the code javascript
i tryn some advice form internet but it dosent work
someone with some tick
thanks
|
|
|
|
|
|
hi
thanks for the time
i wish clean my command window i dont know to do >cls in my command window
but from this signal > i can write cls and it clean my command window
i konw how i exit from > for can type ?variable
can say me the command to can to go > and can exit from it
thanks for all
|
|
|
|
|
Tne > character is used as prompt by a lot of console tools. It would help if you could mention what it is that you are doing.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I have been implenting a processing page as per this article http://www.codeproject.com/aspnet/AsyncProcessingMessage.asp where I show a processing page and then go on to some other page as needed. My problem is that I want to go back to the original page that called the processing page but when I do this it thinks it is a new page and the IsPostBack is false.
This means that I loose the state of the page including the error message that I would like shown and I must go back to the original page to allow the user to make some changes.
Any ideas?
|
|
|
|
|
Of course it thinks that it is a new page. It is.
If you have anything in ViewState, that is already lost when you leave the page. If you wan't to retain any information, you would have to actually send it along from page to page.
Web pages are stateless by nature, meaning that they are not aware of previous pages, only the information that is actually sent to the page. Every request is a completely new page from scratch, even a postback.
---
b { font-weight: normal; }
|
|
|
|
|
How would I send the information along from page to page? Can you give me a sample to look at?
|
|
|
|
|
The Users are stored in a database on a mySQL server that uses the PASSWORD() function to encrypt the passes. What would be the best way to authenticate users?
I read about the Forms authetnication offered by the login control. I have to install a membership database on the server using aspnet_regsql
What if my mySQL server already has a table that stores the user information? Can i still use aspnet_regsql?
Let's say I dont wanna use the Forms authentication offered by the login control and I want to write my custom control.
|
|
|
|
|
|
I have made a flash interface that opens web pages I have created in asp.net. The problem I have is that my whole site basically needs session variables to run, and these variables are decided on the opening page, which is now Flash, depending on the users selection.
So I know that Flash variables can be sent using POST. But how do I retrieve these variables through Asp.Net/VB.net?
Thanks.
|
|
|
|
|
:|Hi all,
i want to display the page count for the records to display in a page.
i have the total records.
now i want to display the total pages number.for each there will be 10 records.
now if i divide the totalrecords by 10 i may get a float value, but i want to round it to next number ie., if 168/10 = 16.8 i want it to be 17
can anyone help....
|
|
|
|
|
System.Math.Ceiling(16.8) = 17
System.Math.Floor(16.8) = 16
cheers
P
|
|
|
|
|
You don't need to use float values at all. Use this formula:
pages = (items + pagesize - 1) / pagesize
e.g.
pages = (items + 10 - 1) / 10
---
b { font-weight: normal; }
|
|
|
|
|
thanks for your answers!
|
|
|
|
|
I am using a user control to insert some text into one of my asp.net pages.
However I am trying to make the scr="..." dynamic so that it takes the value from a variable which is storing the id from the url. This value is also being used in a database query.
My question is how do i insert a variable (the id from the url) into the <%@ Register...%>, so that i can change the src according to the correct content page?
For example:
<%@ Register TagPrefix="course" TagName="content" Src="course/blue.ascx" %>
But i need something like:
<%@ Register TagPrefix="course" TagName="content" Src="course/" + course_name + ".ascx" %>
where course_code = the id taken from the url
Any help would be much appreciated
|
|
|
|
|