|
Good Evening My friends
I have been helping you , now its your turn to help
Due to Limitations in the Telerik, meaning that there is no nice Pop Control , and i want to create my own as i did in my previous article. I have used the DevExpress Popup Control and i have a Telerik Gridview inside it and i can nicely search for records and i can select the record from the Grid and i have a button that saves take an ID of that record like
protected void btnselect_Click(object sender, EventArgs e)
{
String Ref =null;
foreach (GridDataItem dataItem in grdactsandbills.MasterTableView.Items)
{
CheckBox chkselect = (CheckBox)dataItem.FindControl("chkselect");
if (chkselect.Checked)
{
Label lblReferenceNumberID = (Label)dataItem.FindControl("lblID");
Ref = lblReferenceNumberID.Text;
}
}
txtreferencenumber.Text = Ref;
}
this Button is in a PopupModal(DevExpress) , when this button is Clicked if assign that value to a textbox that is not part of the modal. and you can see i am doing it on the server side and the break point goes there and the watch shows that yes the value has been assigned to the textbox, but after i close the pop, the Textbox is empty. I am just buffled by this. Below is my markup
<asp:UpdatePanel ID="Update1" runat="server">
<ContentTemplate>
<asp:Panel ID="ModalPanel" runat="server" HorizontalAlign="Center" Style="display: none" BackColor="Green">
<br />
<asp:Label ID="Label7" runat="server"></asp:Label>
<asp:Button ID="btnCancel" runat="server" Text="Close Me" />
</asp:Panel><table class="style1">
<tr>
<td>
<asp:Button ID="btnadd" runat="server" Text="Add" onclick="btnadd_Click"
Height="31px" Width="63px" />
</td>
<td>
<asp:Button ID="btnsearch" runat="server" Text="Search"
onclick="btnsearch_Click" Height="33px" Width="77px"
onclientclick="ShowLoginWindow() ;" />
</td>
</table>
<dx:ASPxPopupControl ID="DevxPopup" runat="server"
PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
ClientInstanceName="DevxPopup" ClientIDMode="AutoID"
CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass"
SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css"
HeaderText=".:::Search:::." Modal="True" AllowDragging="True"
AllowResize="True" AppearAfter="100" CloseAction="CloseButton"
DragElement="Window" Width="100%">
<ContentCollection>
<dx:PopupControlContentControl runat="server">
<asp:Panel ID="Panel" runat="server">
<br />
<table class="style3">
<tr>
<td>
<asp:Label ID="Label6" runat="server" Style="Float:right" Text="Reference Number:"></asp:Label>
</td>
<td class="style4">
<asp:TextBox ID="txtRefNumber" runat="server"></asp:TextBox>
</td>
<td class="style6">
<asp:Button ID="Button2" runat="server" OnClick="btnsearch_Click"
Text="Search" />
</td>
<td>
<asp:Button ID="btnselect" runat="server" Height="27px"
OnClick="btnselect_Click" Text="Pick" Width="73px"
OnClientClick="GetValue();" />
</td>
</tr>
</table>
<br />
</asp:Panel>
<telerik:RadGrid ID="grdactsandbills" runat="server"
AllowFilteringByColumn="True" AllowMultiRowSelection="True" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" GridLines="None"
ShowGroupPanel="True" Skin="Black">
<MasterTableView>
<Columns>
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="chkselect" runat="server"
/>
<asp:Label ID="lblID" runat="server" Text='<%# Eval("FilesID")%>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Subject Title">
<ItemTemplate>
<asp:Label ID="lblSubjectTitleofbilActRef" runat="server"
Text='<%# Eval("Dateentered")%>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Date Received">
<ItemTemplate>
<asp:Label ID="lblDateReceived" runat="server"
Text='<%# Eval("Dateneeded")%>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Ministry ID">
<ItemTemplate>
<asp:Label ID="lblMinistryID" runat="server" Text='<%# Eval("Daysavailablebeforebringup")%>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Date to AG">
<ItemTemplate>
<asp:Label ID="lblDatetoAGr" runat="server" Text='<%# Eval("Reasonsforbringup")%>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Datereceived from AG">
<ItemTemplate>
<asp:Label ID="lblDatereceivedfromAG" runat="server"
Text='<%# Eval("Neededby")%>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Date send M Signature">
<ItemTemplate>
<asp:Label ID="lblReferenceNumber" runat="server"
Text='<%# Eval("ReferenceNumber")%>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Date send CS">
<ItemTemplate>
<asp:Label ID="lblDatesendCSr" runat="server" Text='<%# Eval("Dateentered")%>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Date send HE signature">
<ItemTemplate>
<asp:Label ID="lblDatesendHEsignature" runat="server"
Text='<%# Eval("Enteredby")%>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<CommandItemSettings ExportToPdfText="Export to Pdf" />
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
</MasterTableView>
<SelectedItemStyle BackColor="#FF9966" />
<ClientSettings AllowDragToGroup="True">
<Selecting AllowRowSelect="True" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<Animation AllowColumnReorderAnimation="True"
AllowColumnRevertAnimation="True" />
</ClientSettings>
</telerik:RadGrid>
</dx:PopupControlContentControl>
</ContentCollection>
</dx:ASPxPopupControl>
</ContentTemplate>
</asp:UpdatePanel>
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi,
I have a seacrh which returns me a list of objectA.
Can I bind this list to gridview for display or which is the best way to do this .
Thanks
|
|
|
|
|
Yes, you can bind List to gridView for display.
This [^] looks as Bes and easiest way to do same.
You simply need to do:
GridView1.DataSource = myList
GrdiView1.DataBind();
myList can be ArrayList or any other list.
|
|
|
|
|
Good answer, 5.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Hi all,
I Have created one User control DLL named WindowsControlLibrary through Windows Form Control Library in C#. Now i want to link that dll file to a asp page so that it can be viewed in the web page. Can anyone please help me how to add that user control in the asp page???
|
|
|
|
|
Hi,
Click here[^] and here[^]
The above approach will do the job for you but in my openion you must consider the following:
1. It will work on in Internet Explorer. No other browser will be able to run this.
2. There might be some functionality which will not work because of security issue.
|
|
|
|
|
Hi All,
We want to generate xml file based on schema file.
Only the xml file is generated we need to populate data by passing objects, because we need to generate so many xml file.
Final output should be a xml file with data.
New to xml,Please help me with this.
Thanks in advance
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
From your schema file (*.xsd), you create classes with the xsd tool (I describe that in my article Bernie’s Trackviewer[^]). Then instantiate the objects from those classes, and finally write ("serialize") them to xml files.
|
|
|
|
|
thanks
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
I understand how to use App_Offline.htm, and most of its caveats, but what I can't seem to find information on is how it deals with executing threads. What I'm concerned about specifically is this. Our company website allows our users to post online payments for their bill with us. Lets say we go to do production maintenance at night, and drop in App_Offline.htm. But we have 3 users submitting payments at that exact moment. I know that App_Offline.htm will block any further responses from coming from ASP.NET, but does it abort the web services calls, or does it allow them to finish, and only then tear down the sessions?
Thanks in advance.
|
|
|
|
|
If the file exists, then ASP.NET shuts down the application and sends the contents of the file back to the user's browser for any new requests to dynamic pages in the application.So in your case the server side code for payment process wont execute, because users are basically locked out of the application.
You can get more resources in
http://www.15seconds.com/issue/061207.htm[^]
Hope this will help.
|
|
|
|
|
Thanks for the reply, Shahriar. But I was referring more to what happens to any active Web Service calls being made. Let me try to explain it a different way. Let's say the payment process takes 30 seconds to return from a 3rd party vendor (they own the Web Service, we're just calling in to it). 10 seconds in to a call, we drop in App_Offline.htm, and shut the site down. Does the payment process Web Service call to our 3rd party vendor complete? Or is it aborted by the shutdown of our application. Either way, I know that the user is still going to see a "Site Offline" message.
Thanks again!
|
|
|
|
|
Hi,
I am very new to Ajax and was trying to use ajax control tab in asp.net.
I downloaded the Ajax toolkit 3.5 and added them in the toolbar. then i use the toolbar as follows in my ascx page.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Default.ascx.cs" Inherits="MyProject.Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:TabContainer ID="MainView" runat="server" ActiveTabIndex="3"
Width="594px">
<asp:TabPanel runat="server" HeaderText="Submission" ID="TabPanel1">
</asp:TabPanel>
<asp:TabPanel ID="TabPanel2" runat="server" HeaderText="Transfers">
</asp:TabPanel>
<asp:TabPanel ID="TabPanel3" runat="server" HeaderText="Errors">
</asp:TabPanel>
<asp:TabPanel ID="TabPanel4" runat="server" HeaderText="Messages">
</asp:TabPanel>
</asp:TabContainer>
when i run it, it gave error like this:
Server Error in '/ICS' Application.
This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add <head runat="server" />.
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.NotSupportedException: This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add <head runat="server" />.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NotSupportedException: This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add <head runat="server" />.]
AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) +740
AjaxControlToolkit.ScriptControlBase.OnLoad(EventArgs e) +20
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
I don't know where shall I get this HtmlHead Control and where to keep this. Can anyone guide me please ?
suchita
|
|
|
|
|
|
ya i did the same thing and it worked.
Thanks
suchita
|
|
|
|
|
Hi,
I have a list of doc files located on a server, I need to open them on a client side in asp .net form.
I don't want the users to be able to enter the directories or the files (security permissions) directly,
\\servername\c$\directory name, so I removed all security permissions, but I still want the users to be able to open
the files from the web site, can you help me?
thanks,
Yefi
modified on Tuesday, February 15, 2011 7:59 AM
|
|
|
|
|
You can receive the filename by a querystring.
string filename = Request.QueryString["filename"];
Then you can validate everything you need and, if the file is a simple textfile, you can open it and write all its contents to the page.
You can even do this with other file formats, but then you must set the document type and maybe need to use a page only to "download" the file.
|
|
|
|
|
Not good for me, if the filename permissions on the server are minimum I can't open the file.
|
|
|
|
|
But not even the code running at the server side is able to open the file?
If that's the case, it will be impossible to solve.
I think what you want is something like this:
Direct connections to a folder or http folder: They are not able to access the files.
Connections to a page - Such page will be able to see only files located at "some directory". If "some directory" is protected from reading, you may need some type of impersonation.
But, then, the flow will be:
Clients (without any access) will access your page at the server.
Such page will have some type of impersonation, can verify if the file only contains the names (no .., no drive letter and so on) and, even then, it only has access to one directory. It reads the file (if valid) and then returns its contents.
If you need, I can detail better about impersonation, but I don't think that you will really need that.
|
|
|
|
|
First you need to give the user some way of selecting which file they need to open. This can be done through may ways, may be you list all the files on you page?
Once a user selects (knows) which file they want, they don't permission on the server side. But asp.net will definitely need a permission to read/access the files from that folder. If asp.net does not have permission then it will fail.
|
|
|
|
|
In order to open the document on the client side, the encoding must be set to an appropriate type for the relevant document. The thing you need to set is known as the MIME type, for instance - if you want to open up an Excel document, the content type should be set to application/vnd.ms-excel. I hope that this helps.
|
|
|
|
|
Hi,
is there anyway to create dynamic variables at the runtime based on a
string input from another function
string datatypestring="int";
using this datatypestring i need to create a integer variable at run
time.is there any methods available in reflection to create dynamic
variables(like int, double etc)
|
|
|
|
|
|
Yes, there is, but you must first get the real type (or must do conversions by your own).
Type type = Type.GetType("System.Int32");
object value = Activator.CreateInstance(type);
But note that I am using "System.Int32" and not "int". For double, you must use "System.Double".
After creating it, it returns as object, but casting it will work.
|
|
|
|
|
I am making outlook2010 add-ins by using visual studio 2010.
I want menu to which image top and Caption is below.
So i was coding as below.
But when i run outlook , i can see menu which image is left and Caption is right.
1. How can i Fix This?
2. And I have other question
I want to show submenu when i click right button.
How can i add? now i am reference msdn but there is not answer.
button_1.Style = Office.MsoButtonStyle.msoButtonIconAndCaptionBelow;
button_1.Caption = "Button 1";
button_1.Tag = "Button1";
button_1.Picture = getImage();
sealed public class ConvertImage : System.Windows.Forms.AxHost
{
private ConvertImage()
: base(null)
{
}
public static stdole.IPictureDisp Convert
(System.Drawing.Image image)
{
return (stdole.IPictureDisp)System.
Windows.Forms.AxHost
.GetIPictureDispFromPicture(image);
}
}//sealed public class ConvertImage : System.Windows.Forms.AxHost
private stdole.IPictureDisp getImage()
{
stdole.IPictureDisp tempImage = null;
try
{
System.Drawing.Icon newIcon = new System.Drawing.Icon(@"Stars1.ico");
ImageList newImageList = new ImageList();
newImageList.Images.Add(newIcon);
tempImage = ConvertImage.Convert(newImageList.Images[0]);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return tempImage;
}//private stdole.IPictureDisp getImage()
hi
My english is a little.
anyway, nice to meet you~~
|
|
|
|