|
What doesn't work?
Where is the code to place the DIV in your UI? You need to add DIV dynamic control to some container such that it is visible. Once the Div is visible, all the contents present in it will be visible.
Add controls to div and then add div to some container.
|
|
|
|
|
I added it to my module like this:
<br />
this.Controls.Add(dynDiv);<br />
And like i wrote before when i add innerhtml i get for link this output:
System.Web.UI.WebControls.HyperLink
|
|
|
|
|
Which line of my answer you were able to got?
Adding a div to any container:
You did: this.Controls.Add(dynDiv); totally WRONG
Where is the container to which you added it?
It would be something like if you have a panel in the page:
Panel1.Controls.Add(dynDiv);
Adding controls to the div:
You did: dynDiv.InnerHtml= link; again WRONG
Is this the add the controls?
It would be:
dynDiv.Controls.Add(link);
You are done!
I would suggest you to pick a book please. Read it. It will help improving fast.
|
|
|
|
|
If i add link as control to Panel, it works, but all the links are shown at the bottom. If i add links to div, i get error at page load.
I have one div. Is it possible to show few hyperlinks at random places in div? For example i am getting some info and i am adding info in single div with div.Innerhtml+=info
How could i add hyperlink at the end of one part of info?
Hope you understand what i am trying to do.
|
|
|
|
|
instead use Panel1.Controls.Add(MyDiv); try using Panel1.Controls.AddAt(0, MyDiv);
Where 0 is the position of the controls!
|
|
|
|
|
Hi, I have a tab container with two tab panels on default.aspx as
Default.aspx
===============
<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" />
<ajaxToolkit:TabContainer ID="LayerTabContainer"
runat="server"
ActiveTabIndex="0"
Height="600px">
<ajaxToolkit:TabPanel ID="CreateLayerPanel"
runat="server">
<HeaderTemplate >
Layer configuration
</HeaderTemplate>
<ContentTemplate>
<iframe id="LayerConfig"
style="WIDTH: 100%; HEIGHT: 100%"
src="Layers.aspx"
frameborder="0"
scrolling="yes">
</iframe>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="PreviewMapPanel"
runat="server">
<HeaderTemplate >
Preview Map
</HeaderTemplate>
<ContentTemplate>
<iframe id="Iframe1"
style="WIDTH: 100%; HEIGHT: 100%"
src="Preview.aspx"
frameborder="0"
scrolling="yes">
</iframe>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
The first tab panel hosts Layers.aspx and layer.aspx has a Button.
When I click this button from Layer.aspx, I want the active tab (on default.aspx) to change to second tab panel which hosts preview.aspx.
I can not get hold of the tabcontainer in the button click event in the child page.
Any tips how to achieve this?
Thanks,
Vijay
|
|
|
|
|
Hello,
I am trying to import gmail and yahoo contacts in my asp.net website. i m using OpenContactsNet.dll and using following code
GmailExtract extractor = new GmailExtract();
NetworkCredential nc = new NetworkCredential(txtUserName.Text, txtPassword.Text);
bool res = extractor.Extract(nc, out list);
But this code is'nt working. I got false response
what could be the reason??
The .Extract function gives the following error when executes the line of code
HttpWebResponse exportResponse = (HttpWebResponse)contactsRequest.GetResponse();
Error: The remote server returned an error: (401) Unauthorized
Please help me in this regard as i have tried every thing. I place the app on www root but still no luck.. plzz help
|
|
|
|
|
Asfand wrote: Error: The remote server returned an error: (401) Unauthorized
Hmmm, could it be the username and password are not correct?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I wish that could be the easiest reason but not on my case. Id and pass are perfect...
|
|
|
|
|
Sometimes its the obvious things that trip us up, but not this time. Sorry, I'm not familiar with the API. Perhaps the credentials need to be set at a different level passed in a different manner.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello!
I have create a demo dynamic webservice solution.
the class Customer
public class Customer
{
private string firstName;
private string lastName;
private DateTime DOB;
}
[WebMethod]
public string getFullName(Customer info)
{
return info.FirstName + " " + info.LastName;
}
I build the SOAP request message for "getFullName" method and send it.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getFullName xmlns="http://tempuri.org/">
<info>
<FirstName>Bill</FirstName>
<LastName>Gates</LastName>
<DOB>28/11/1955</DOB>
</info>
</getFullName>
</soap:Body>
</soap:Envelope>
But the SOAP respone message is null!
I change type of param DOB to string, it works!
whats wrong with DateTime type???
please help!!!(sory! my english isn't good!)
TKS for read!
modified on Tuesday, May 25, 2010 2:03 PM
|
|
|
|
|
Hi all,
I've got a problem using Web Parts in ASP.NET 2.0 - and I'd really appreciate some assistance.
Everything works fine until we make a change that causes the site to be recompiled - either by putting an updated file in App_Code or by making a change to the root web.config file.
Once either of those actions is done, some users (more than one, but certainly not all of them) report that any personalization that they have made to their page gets lost. This is understandably proving annoying to my users. I have a test page on a separate test server/personalization database, and I can muck about changing every file on the site but still can't reproduce the problem for myself. But I have seen it happen on the live box, so I know they're not lying to me
The only thing that's non-standard about the server configuration is that my live environment comprises two separate IIS servers using round-robin DNS as a crude load-balancer, and both servers reading/writing the same personalization database. This doesn't seem to give any problems (except maybe for this one!), but I mention it because it's the one thing that makes me a little nervous about this setup.
Thanks in advance for any help or advice that anyone can offer.
Rich.
|
|
|
|
|
hi,
i have an iframe in which content is having an hyperlink inside DIV. on Main page load
im displaying another aspx page in iframe at that the hyperlink is touching down border of DIV it should come in the middle,but when i click the hyperlink inside the iframe it is alligning properly..this issue comes in IE7 only..
|
|
|
|
|
Dear Friends,
I have written the following code to upload .xls file. I want to upload only .xls file.
if (fuploadPaySlip.HasFile)
{
if (fuploadPaySlip.PostedFile.ContentType == "application/x-msexcel")
{
fuploadPaySlip.PostedFile.SaveAs(Server.MapPath(".") + "//uploadedfiles//" + fuploadPaySlip.FileName);
lblErrorMsg.Text = "Uploaded Successfully";
}
else
lblErrorMsg.Text = "Not a valid File";
}
else
lblErrorMsg.Text = "No File is Selected";
but it is always saying "Not a valid file". I have even tried with other MIME Types like
application/excel
application/vnd.ms-excel
application/x-excel
Still I am getting error. Please anyone can help me. Its very urgent.
Regards,
Dileep.
|
|
|
|
|
Try:
ContentType = "application/vnd.xls";
Another thought to the issue, you using Office 2003 or 2007? Both have different extensions to excel files, might that be the reason!
|
|
|
|
|
Hi,
I want to have a video chat with the webcams within 2 computers , with asp.net and no limited bandwich , please help me , tnx
|
|
|
|
|
|
Dear friends,
I want to upload an Excel file from ASP.NET web form to Sql Server Database. I have all employees salary in the excel file. I want to upload it to the database through ASP.NET web form. I am using ASP.NET 3.5 with C# and SQL Server 2005. Please, anyone can help me, How to upload excel file using the FileUpload control? I need it urgently. Please help me.
Regards,
Dileep.
|
|
|
|
|
use this function
public static DataTable GetDataTableFromExcel(string SourceFilePath)
{
string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + SourceFilePath + ";" +
"Extended Properties=Excel 8.0;";
using (OleDbConnection cn = new OleDbConnection(ConnectionString))
{
cn.Open();
DataTable dbSchema = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (dbSchema == null || dbSchema.Rows.Count < 1)
{
throw new Exception("Error: Could not determine the name of the first worksheet.");
}
string WorkSheetName = dbSchema.Rows[0]["TABLE_NAME"].ToString();
OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM [" + WorkSheetName + "]", cn);
DataTable dt = new DataTable(WorkSheetName);
da.Fill(dt);
return dt;
}
}
This will return you datatable after that with the help of loop insert it into database
|
|
|
|
|
Hi All,
Im created web application using .net 2008, and its hosted and working fine, now i created a another console application to my same solution as new project, i did some stuff there,added the reference from backend classes, its also woring fine.
My requirement is set that console application to SQL job, so i did that by setting my local solution path
(ex- E :\Test\WebApp\Console\Test.exe). its working fine too.
My problem is when i host this console application with web project, how can set the reference to console application?.
I created sub folder for console application inside my web project in hosting server, then added the console exe and app.config file, but that time my sql job is not working , should i add bin folder there?
what is the path should i follow?
Pls give some ideas?
Thanks
|
|
|
|
|
Think about it. With a web project, all of the code is executed a web server in a room somewhere in the world. A console app would execute on that same machine, if it were even allowed. Who would see the app?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i used that console app for some sort of mail sending mechanism, as i said i have set that console for SQL job already its wroking, what i really need to know is how can host that console in the same project?
|
|
|
|
|
indSoftware wrote: how can host that console in the same project
You can't, shouldn't, and it makes no sense to even try doing so. See my previous explanation.
If you simple want to execute code you don't need a console app to do so. Create a library and call class/method as necessary.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
ok thx for your reply, if i create a class library how can set that it to SQL job for daily scheduling.
Thanks.
|
|
|
|
|
The same way did in the console app. Seriously, you need stop and learn a bit more about the differences between console app, web apps and class libraries.
I know the language. I've read a book. - _Madmatt
|
|
|
|