|
I have got stuck up with ASP.Net tree view.
Business requirement
There are parent type nodes called category (folders for example).
Child node can be category (folders) or factor (files for example) in business term. Factor cannot have child. In the sense a leaf node can be category or factor. The requirement is of different image on expand collapse of nodes for category and for leaf node which are factor they want third image, if lead node is a category then they want image that is same as expanded category.
Problem and scenario
I did some property settings to bring these images as per requirement. But the problem came in picture when I tried to add image through code for leaf nodes. The leaf node are getting indenting compared to their siblings. They are starting from other nodes text starting point ,that is the reason they are getting indented. I could not include NoExpandimageURL property for leaf node because my leaf nodes are of two types and have different images for each type. Is there any way to make this proper align?
Code written for tree view generation.
(Source file)
<asp:TreeView ID="tvwCategories" ExpandDepth="2" runat="server" CollapseImageUrl="../../_LAYOUTS/IMAGES/category.gif"
ExpandImageUrl="../../_LAYOUTS/IMAGES/CatCollap.gif" NodeIndent="15" Width="209px" BorderColor="Transparent" BorderStyle="None"
OnSelectedNodeChanged="tvwCategories_SelectedNodeChanged" NodeStyle-HorizontalPadding="5" NodeStyle-VerticalPadding="0">
hemant basvapattan
|
|
|
|
|
Hi Friends,
The following code has been used in one of the asp page to fetch data from excel sheet and insert into table. Excel Driver part is used to do this. But however the excel sheet includes more than 130 rows. But when importing it just imports only 91 row and the remaining rows are not getting uploaded in the table. Please Please help.
ExcelDriver Part:
set objConn = Server.CreateObject("ADODB.Connection")
set rsExcel = Server.CreateObject("ADODB.RecordSet")
strName = "\Uploads\bicreports\" & strFileName
servername = server.mappath(strName)
' Create a connection string.
strConnectionString = "DBQ= " & servername & _
";DefaultDir=" & SERVER.MAPPATH("/bicreports/") & _
";Driver={Microsoft Excel Driver (*.xls)}" & _
";DriverId=22;FIL=excel 8.0" & _
";ImplicitCommitSync=Yes;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5" & _
";SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
Is there anything wrong with above code attributes...which forces to read only 91 rows...
Its very urgent...Please help...
Thanks lot in advance.
priyaahh
|
|
|
|
|
while I tried to publish my application I got this error "Error 60 The type 'sidemenu' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\emms\ff85cd27\e81f774b\App_Web_yukhk2wj.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\emms\ff85cd27\e81f774b\App_Web_v7eywk8x.dll'
"
as sidemenu' is a user control that I create to use
|
|
|
|
|
I had a Problem but not with a User Control, but the reason to the Problem was that i have Imported a Reference Twice. Meaning to resolve the Problem go to your References in the Solution Explorer and and Remove the Reference.
Am not sure what is happening in your case
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
i am using date time picker.i want to change the date format. currently it showing 1/23/2009 i want 1 jan,2009. its not showing date format property.it has reguler exp. "\d{1,2}\/\d{1,2}\/\d{2,4}" with it can we change the format of the date .. thnx..
|
|
|
|
|
that mean that date time picker does not allow you to change date format
why dont you use some other date time picker like gmd date picker which is free is fullfill your requirement..
umerumerumer
|
|
|
|
|
Hi guys,
I'm trying to do a file download for a user in ASP.NET. The method I'm using is writing the entire file to the Response the client gets. This approach works as expected in IE7 / Firefox / Etc. Unfortunately this approach crashes IE6. Locally on my machine (XP + IIS 5.1) it also works in IE6, but on the server machine (WIN2003 + IIS 6) it doesn't.
Response.Clear();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
Response.Charset = "";
Response.ContentType = "application/text";
sr_File = new StreamReader(file.FullName);
Response.BinaryWrite(new BinaryReader(sr_File.BaseStream).ReadBytes((int) sr_File.BaseStream.Length));
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.Flush();
HttpContext.Current.ApplicationInstance.CompleteRequest();
sr_File.Close();
Any ideas are greatly appreciated!
Thanks!
|
|
|
|
|
From where you are getting this file? If it is not on database, all you need is to redirect to the file using Response.Redirect(FileToDownload) . You don't need all these coding.
|
|
|
|
|
That might work, but instead if I generate this file dynamically I should follow this approach that clearly doesn't work
|
|
|
|
|
I am trying to change the font size on a radio button !! i add data to the radiobutton threw a sql query. So the items are databound. But if i set the font size it stay by default 12, How will i be able to change the font size after the data has been bound to the Radio button ?
Thank you ....... i hope.
|
|
|
|
|
You might be using theme.
If yes, Do RadioButton.EnableTheming = false;
This should now work if you are setting the font-size correctly.
|
|
|
|
|
Hello,i want to store video and picture file with the unique user(the member or existing user)using SQL2000,the what relation will be suitable,[user table](PK--user_ID
User_Name,User_Password)[Resume table](PK--CV_ID, FK--User_ID,name,father_name ect)[Picture table](PK--Pic_ID, FK--CV_ID,picture,Content type,size,data)[Video table](PK--Video_ID, FK--CV_ID, Video_name,Content type,size,data) is this correct relation ship?and should i use user_id Fk in video and picture table?and also i want show the data for register member.
Please help me out as soon as possible(ali2k6@gmail.com)
|
|
|
|
|
I have the following line of code (.NET 2.0):
myDataView.RowFilter = "SELECT DISTINCT Auto";
where Auto is one of my column names. This throws the following exception:
Syntax error: Missing operand after 'DISTINCT' operator.
Any suggestions on what this is really trying to tell me?
krishna veer singh
|
|
|
|
|
|
write like select distinct(auto)
|
|
|
|
|
I try but its not working....
krishna veer singh
|
|
|
|
|
You can't have SQL statements in RowFilter expression. Please read[^] the documentation.
|
|
|
|
|
Good Morning All
Am working on a Setup Project. I have an Installer that write on the Web.config file like this
public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
String MyServer = Context.Parameters["MyServer"];
String server = "Username=sa;Password=wow;Database=OBooking_Master;Server=" + MyServer;
String Key = "TESTY";
UpdateConfig(Key, server);
}
public void UpdateConfig(string strKey, string strValue)
{
Configuration objConfig = WebConfigurationManager.OpenWebConfiguration("~");
AppSettingsSection objAppsettings = (AppSettingsSection)objConfig.GetSection("appSettings");
if (objAppsettings != null)
{
objAppsettings.Settings[strKey].Value = strValue;
objConfig.Save();
}
}
Cool , now after i compile everything, testing my setup, i get an Error that says
The Application relative Virtual path '~' is not allowed here
i have tried the Following
Configuration objConfig = WebConfigurationManager.OpenWebConfiguration(HttpRuntime.AppDomainAppVirtualPath);
An i got an Error
Object reference not set to an instance of an object
And when i do it like this
Configuration objConfig = WebConfigurationManager.OpenWebConfiguration(@"~\Install_Helloworld\Web.Config");
and i got the Error Below on the Picture below.
In the CustomActionData Property i have this
/MyServer="[EDITA1]\"
Does it look ok for you?
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Hi, In my project i have to display a calendar according to the inputs. The inputs are Month and Year?. How it is possible to display the particular month of the year?
Can anyone help?
|
|
|
|
|
am working in online application if i click link button an excel document will open i user this but it shows some error..
protected void lnkbtn_Click(object sender, EventArgs e)
{
string filepath = MapPath("king.xls");
FileInfo myfile = new FileInfo (filepath);
Response.AddHeader ("Content-Disposition","inline; filename=" + myfile.Name);
if (myfile.Exists)
{
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment; filename=" + myfile.Name);
Response.AddHeader("Content-Lenght", myfile.Length.ToString());
Response.TransmitFile(myfile.FullName);
Response.End();
}
}
send me suggestions...
|
|
|
|
|
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment");
Response.AddHeader("filename", "test.xls");
Response.ContentType = "application/vnd.ms-excel";
StringWriter oStringWriter = new StringWriter(new StringBuilder(pstrText));
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
HttpContext.Current.Response.Write(oStringWriter.ToString());
HttpContext.Current.Response.End();
use this code rather than yours...
This is working ...
In your code just replace the spelling of Length in content-length and take a look ... as well.
Abhishek Sur
|
|
|
|
|
string pstrText = "king.xls";
StringWriter oStringWriter = new StringWriter(new StringBuilder(pstrText));
error comes in stringbuilder
did i miss any assemble reference
|
|
|
|
|
add the
system.io and system.text namespace in your cs file
|
|
|
|
|
In my aspx page,I have a modal popup,on which there is a textbox and a button.
On click of the button(button_click()) ,I have written the code to save the textbox content to database.Everything seems like a simple scenario.
But somehow,when I click the button on the modal popup, it is not firing any event.
I have done the same thing on some other pages also and there it is working properly.
This is my design code :
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="addComment_lnk"
BackgroundCssClass="modalBackground" PopupControlID="Panel1">
</ajaxToolkit:ModalPopupExtender>
<asp:LinkButton ID="btn_hide" runat="server"></asp:LinkButton>
<asp:Panel ID="Panel1" CssClass="popBox" runat="server" Style="display: none">
<div>
<p style="text-align: center">
<table>
<tr>
<td class="title">
Post Comment :
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="comments_txt" CssClass="popInput" TextMode="MultiLine" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="post_btn" CssClass="button buttonGreen floatRight" OnClick="post_btn_Click"
runat="server" Text="Post" />
<asp:Button ID="cancel_btn" CssClass="button buttonGray floatRight" runat="server"
Text="Cancel" />
</td>
</tr>
</table>
</p>
</div>
</asp:Panel>
<asp:LinkButton ID="addComment_lnk" runat="server">Add Comment</asp:LinkButton>
Can anyone please suggest any possible reasons for the button not firing event.
Thank You.
|
|
|
|
|
I have two modules in my project User Side and Admin Side. I want to Use Forms Autentication Only for Admin Module. How can i use Forms Autehntication Only for this. I Tried to Create a another web project for Admin Module. But when i compiling am getting the following error.
Error 1 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Can i handle these two modules with the main web.config file. Or Should i create another web project like this, If it is then why this Error is coming.
|
|
|
|