|
Hi,
U can convert the columns to template column in property builder
then set following properties according to your requirement:
<asp:TemplateColumn ItemStyle-Width=25% ItemStyle-VerticalAlign=bottom>
<ItemTemplate >
<asp:Label id="Label2" runat="server" ></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="TextBox2" runat="server"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Label runat="server"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
Thanks,
Prabir
|
|
|
|
|
First of all,thank u all for the replies!
However, i am using databinding like this:
I am creating a DataGrid form a DataSet with autogeneratecolumns:
dg.DataSource = ds;
dg.DataBind();
all the columns are autogenerated, thus, we could not convert a specific column into template column. am i right? looking forward to ur reply;P
|
|
|
|
|
Hi,
My web application is hosted on windows2003 server (IIS 6.0).I am facing
one strange problem on client machine, i use response.redirect("url for
Office document like .doc,.xls") to open the any attacment with the records,
in some of the machine the attachement open properly but in some it's not(it
seems like client gets back the response and page appear for fraction on time
and gets dissapear.) even when i run the application on server itslef i
notice that attachment getting open when i use http://localhost in my url but
problem occurs when i use IP address or machine name. Is it something related
to IE setting or some setting of IIS.
but the things work perfectly on any machine if attachment is pdf file.
Any help will be appreciated.
Regards,
Ritesh
|
|
|
|
|
Do following steps.
1. Include "Microsoft Office 11.0 Object Library" on your project and get file content of your file using following steps
Word.ApplicationClass wordApp = null;
Word.Document doc doc = wordApp.Documents.Open(ref file,ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing,ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,ref missing, ref missing, ref missing);
//Save the contents of File in database as
string str = doc.Content.Text;
//Save str to database
2. Open a temp page as follows.
Response.Write("");
Response.Write("window.open('temp.aspx');");
Response.Write("</"+"script>");
3. On this temp.aspx page load do following steps
//Retrieve File contents eighter form database wich we have saved in step1
byte [] FileContent = (byte[])row["FileContent"];
Response.Clear();
Response.AddHeader("Content-disposition", "inline;filename="+FileName);
Response.ContentType = "application/msword";
Response.BinaryWrite(FileContent);
Response.End();
//If this not works then do following
HttpContext.Current.Response.BinaryWrite(FileContent);
Response.End();
:->
<div class="ForumSig">
#Abhi#</div>
|
|
|
|
|
Hi Abhishek,
thanks you very much for you reply.currently i am doing same steps,i.e opening temp. page and doing response.redirect to target file,It was my mistake that i forgot to mention that my application is sort of document management system and it stores file with any extension on FTP server.As sugested by you in Step 3 is mainly deal with msword documents,but i am also facing same problem with autocad (.dwg) files. and in my temp page i am also doing further proecessing of file like converting it into pdf format and applying watermark onfly etc, so i guess converting files into binary format further slowdown the whole process (as size of files are in 10+MB). I am not sure but i guess it has something to do with mime setting as when i added *.* in the mime type list of my iis server it's work file (but only if i use localhost in my url).
If you can have any suggestion i would be very helpfull....
thanks,
Ritesh
|
|
|
|
|
Hi,
After some R&D i think i figured out the solution...........it all has do to with IE 6.0 's trusted site's security setting.I just set "Automatic Promting for file download" setting to enable and it works fine.
Regards,
Ritesh
|
|
|
|
|
I create solution contain 2 project first one for web pages and second one for class library
Now when I modify one class by changing parameter or adding new method to class
And then when make instance form this class in first class I can not see last modification
Notes : for the first project I add class library as reference project and I build solution but still I can not see my modification on class library when I call it form first project
Can any one explain and I appreciate
Thanks
|
|
|
|
|
Are you using VS 2003 or 2005? Can you see the new assembly of the class library project in the bin folder of the web project when you build the solution?
|
|
|
|
|
im using VS2005 and yes i can see the assembly if i build solution! but still problem is still?
|
|
|
|
|
i remove the *.dll from BIN folder and the build solution ,its working now thanks a lot
|
|
|
|
|
Hi All,
Wonder if you can help me with this one?
I have a datalist with an EditItemTemplate defined. Within the EditItemTemplate I would like to have a radiobuttonlist that allows the user to specify the type of item. The radiobutton would autopostback and, depending on which radiobutton was clicked, different textboxes would become visible within the line item that is currently being edited.
I can't figure out where to put the code to capture the radio button that was selected and thus make the relevant text boxes visible in the edititemtemplate.
Any help would be greatly appreciated.
|
|
|
|
|
What you need to do is to create a handler for the SelectedIndexChanged of the RadioButtonList control and you can use the SelectedXXX properties of the control to access the selected item.
|
|
|
|
|
Hi minhpc_bk, Thanks for the reply.
The event handler gets called as you would expect when the radio button list is on the form in a "usual" position, but if I put it in the edititemtemplate the handler is not called. I added OnSelectedIndexChanged to the control and now the handler is called but the RadioButtonList1 object is Nothing.
I ended up having to get set up a datalistitem object using
datalist.item(datalist.EditItemIndex)
then using datalistitem.findcontrol to grab the radiobuttonlist.
But hey, it works now and you pointed me in the right direction, so thanks!
|
|
|
|
|
hi all
i want the page to display a message, i knw hw to do it by script, but hw to make the ASP code calls the script method as i wrire the code in the code behind page not in the HTML page
thank u
abdelhameed81
|
|
|
|
|
Hi,
you can use Page.RegisterClientScriptBlock() method to register client scripts.
|
|
|
|
|
thank u but i tried the following code
if (!Page.IsClientScriptBlockRegistered("mytest") )
Page.RegisterClientScriptBlock("myrest", "alert('Hello');");
but not work
abdelhameed81
|
|
|
|
|
it works ok here; although you wrote "myrest" the seccond time.
|
|
|
|
|
hi all
i am using a multitext field to enter data in the database but when i press (enter) in the text box and check the tables in the db i found that the new line is not inserted in the table
plz tell me wht to do
abdelhameed81
|
|
|
|
|
There is no reason why the newline should not be saved. I think that it's saved all right, but not displayed the way that you expect in the user interface for the database. What database are you using, and what user interface do you use to view the data?
---
b { font-weight: normal; }
|
|
|
|
|
hi all,
I am trying to develope a mailserver control panel in asp.net with c# using Exchange server 2003.I want all the details to read mails from Exchange server..
|
|
|
|
|
IMO, for that you'll have to implement two parts:
+ Code to access the Exchange Server to pull data, and you may consider using the WebDav .Net , other choices are CDO or MAPI.
+ Code to implement the custom panel control to display data, and it depends on how you want to show data you choose a way to go, you can see MSDN for the details on how to develop a custom server control.
|
|
|
|
|
Hi Friends,
In a gridview i have a bounded image column,thats working fine.
My problem is
when some one clicks on the edit button in the grid, I want to get the image name in a variable for some reason.
can any one help me pls.
I am passing RowId and column id
like this
GridViewRow row=mygridview.Rows[1];
row.Cells[2] //where cell 2 is an image column.
How can i get value of cell 2 in a variable.
thanks
Naveed Kamboh
|
|
|
|
|
Does this work?
(GridView1.Rows[1].Cells[2].Controls[0] as Image).ID
|
|
|
|
|
Thanks dear it worked for me as
Image im1 = row.Cells[2].Controls[1] as Image;
this.imgCurrent.ImageUrl=im1.ImageUrl;
I was using template column.
thanks for the great help.
Naveed Kamboh
|
|
|
|
|
Hi
Please help !!!!!
I am using Crystal Reports 11.5 R2 with Visual Studio 2005 on XP with SP2 for development. The program runs fine on my development machine and the reports open up fine. When I run the program on the a Windows 2000 Server I ge the following error, even though I gave ASPNET, IUSR,IWAM and Everyone full access to the directory that has the reports, the reports themselves and the temp direcories.
Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Access is denied.
Source Error:
Line 422:
Line 423:
Line 424: oRpt.Load("d:\mcsistest\" & dbrptName)
Line 425:
Line 426: 'oRpt.Load("C:\Documents and Settings\JP\My Documents\Visual Studio 2005\StudentInfo\" & dbrptName)
Source File: D:\mcsistest\colMain.aspx.vb Line: 424
Stack Trace:
[COMException (0x80004005): Access is denied.
]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +87
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +279
[Exception: Load report failed.]
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +341
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +964
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +73
Studentinfo_colMain.CreateReport() in D:\mcsistest\colMain.aspx.vb:424
Studentinfo_colMain.studCINF() in D:\mcsistest\colMain.aspx.vb:307
Studentinfo_colMain.start() in D:\mcsistest\colMain.aspx.vb:193
Studentinfo_colMain.btnSubmit2_Click(Object sender, EventArgs e) in D:\mcsistest\colMain.aspx.vb:176
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Thank you.
|
|
|
|