.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

How to resize iFrame dynamically?

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :ASP.Net
 

This is an examle of how I use iFrame.

<IFRAME id="frame1" src="http://www.google.com"  runat="server"></IFRAME>

How do I dynamically change the size of the iframe?






View Complete Post


More Related Resource Links

How to resize iframe when content loads..

  
I have an iframe on website A which receives the controls from website B once the form is processed on website B. Here is the page on website A with the iframe. I have hard coded the height at 100px:<iframe id="hdnFrm" name="hdnFrm" src="" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="width:90%;height:100px"></iframe> <form action='http://www.link-exchangers.com/adv_links_addber.aspx' target='hdnFrm' method='post' name='form1'> <table width=90% align=center cellpadding=2 cellspacing=0 border=0> <tr><td valign=top>Contact email: </td><td><input type=text name=web_email value="<?=$web_email;?>" style='width:250px'></td></tr> <tr><td valign=top>Reciprocal link: </td><td><input id=web_recip type=text name=web_recip value="<?=$web_recip;?>" style='width:250px'></td></tr> <tr><td colspan=2 align=center><input type=submit value="Save" style='width:100px'></td></tr> </table></form> Once the Save button is clicked, website B processes the data in this form, and sends messages and a

How to Authenticate User on External Site Using IFrame (Dynamically created in SharePoint WebPart)

  

Hi

I've a situation,

- External Site : This site has its own user store (user/password) to log-in to.

- SharePoint WebPart : This webpart will get some readonly data from External Site but for performing any CURD operation on the External Site the user has to Log-in to External Site using IFrame Mechanism (This login form has to be of External site, and UserName/Passwordd should be posted to login-form of External site) sharepoint shouldn't be collecting any user/password credentials. (how can we do this?)

How user gets authenticated in External Site:

1. user Provides username/password.

2. Once authenticated to User Store it set an Authentication Cookie in use browser, thus uses this cookie with every request to perform any CURD operation.

I've to have the similar functionality in SharePoint Webpart. using IFRAME.

Hope i covered all the points in my explaination, if you can provide any blog/code which is dealing with similar kind of approach.

 

 


Thanks
Akhilesh Nirapure

Resize dynamically created controls on Canvas

  

Hello,

This is my first thread on this forum and i'm a beginner on WPF.

After google-ing for long time, it seems I can't find a solution for my problem.

I'm working on WPF form. The form contains a canvas and I create Labels on the Canvas dynamically at run-time.

First I had a problem to move the control on the canvas, but eventually I solved this problem by using a class implemented by Josh smith from

his article on codeproject.com. Now, I can move my lables freely on the Canvas.

But now, I want to resize the labels width or height that are created at run-time.

I changed the cursor of the mouse to (horizontal scroll or Vertical scroll) when it touched when of the edges of the label.

but I can't find how to implement the resizing when the mouse goes down or pressed to stretch the label.

Many tutorials found on the web talks about resizing controls the are previously declared in xaml and I want to implement it at code-behind.

Can please help me.

Thanks for help in advance.


Resize pop-up window dynamically

  

HI all,

From my web page, I open a  pop-up window with some dynamic list of controls depending on the data from main page.

Is there any way to  dynamically set the pop-up window size  or resize the length and width if the pop-up window so that it displays only the dynamic controls , eliminating the extra spaces.


how to set iframe height and width dynamically

  

how to set height and width of this iframe using jquery

"<iframe id=frame1 width='480' height='405' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'></iframe> <div id='loading'> Loading . . .    </div>  ";


SP.UI.ModalDialog.showModalDialog - resize window dynamically

  

We have created a SP.UI.ModalDialog.showModalDialog popup. Length and width of the widow is specified when created. Now, we want to open another page in the same popup with different width and height of the popup window.

We open new page in the existing popup window just by creating a <asp:HyperLink>. Getting it on server-side and setting its  "NavigateUrl" = "NewPage.aspx" to new page and "Target" = "_self". But this "NewPage.aspx" has different width and height. We want to change width and height of popup window as per "NewPage.aspx"

Any help?


http://farhanfaiz.wordpress.com

Dynamically Create Controls in ASP.NET by Using Visual C# .NET

  
This article demonstrates how to dynamically create a control for an .aspx page. The sample project does the following:
Creates two TextBox controls.
Verifies that the contents (TextBox.text) and the attributes of the TextBox are saved across posts to the server.
Illustrates handling events that are posted by a dynamically-created control

Dynamically Create Controls in ASP.NET with Visual Basic .NET

  
This step-by-step article describes how to dynamically create controls for an ASPX Web page.

The sample project does the following:
It creates two TextBox controls.
It verifies that the TextBox contents (TextBox.text) and attributes are saved across posts to the server.
It describes how events that are posted by a dynamically created control are handled.

dynamically adding sql server columns based on number of files in fileuploader

  

I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.

 

I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!

 

Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")

objConn.Open()

using the linqDataSource control programmatically (dynamically)

  

Hello,

my scenario is this: I want to use the linqDataSource control to bind data to a gridview for it's efficient built-in paging and sorting features *but* I don't want the data to be bound until the user has input various search parameters, so I need to bind the data from a button click event. Also, the search options will be somewhat complex in that there will be several optional search parameters, via various dropdowns and textboxes, so I can't just declaratively/statically setup all the WHERE parameters on the linqDataSource (at least I'm assuming I can't, or that it may result in poor performance if I do and just assign default values like the everything wildcard '%' for the cases the user doesn't use a particular search parameter). Given that brief description, here is an example of what I'm doing, but with only one WHERE parameter for simplicity, the real code will be adding anywhere from 1 to about 12 WHERE parameters depending on how the user sets the search options in the GUI.

the linqDataSource on the aspx page:

<asp:LinqDataSource ID="ldsMain" runat="server" 
        ContextTypeName="myProject.myProjectDataContext" 
        Select="new (field1, field2, field3, etc..)" 
        TableName="theTableName">
</asp:LinqDat

Search for a string in my datasource dynamically

  

I am displaying an Rssfeed on my page by using XmlDataSource and Datalist controls.

I want the user to be able to limit the information that is returned to my datalist.  To do this I have a textbox on the form that allows the user to enter their search criteria.

I need to be able to dynamically create a query string utilizing the information that the user entered in the textbox.  I am also using a drop down list and allowing the user to select whether they want to search in the title, description, or all parts of the xml file.

I am having trouble figuring out how to reference the data contained in my textbox in my query string.  Where the query string says 'asp', I want to replace 'asp' with the content from my sSearch variable.  Can anyone tell me how to reference my variable in the query string???

string sSearch = txtSearch.Text;
        string SQuery = "";

        if (DropDownList2.SelectedIndex == 0)
        {
            SQuery = "[contains(title), 'asp')]";
            
        }
  

Persist data in a dynamically populated ListBox in a user control

  

Hi All,

I am trying to persist data in a dynamically populated ListBox in a user control. Here are the details

I have a user control which contains a a listBox and button. On Page_Load of user control I am populating the ListBox control with some values. On Click of button, I am trying to fetch the values which I have selected in ListBox. Though this seems very simple and straight forward I am unable to fetch values.

My Page_Load Function

void Page_Load(object sender, EventArgs e)

{

       If(!IspostBack)

        {

              listBox.items.Add("Item1");

             listBox.items.Add("item2");

             listBox.items.Add("item3");

         }

}

 

My Click Function

Protected Void Button1_Click(object sender, EventArgs e)

{

       string strValue = listBox.SelectedValue

}

 

I have placed brake point at Page_Load and on click function, I am seeing that the moment the breakpoin

Problem in accessing resource file dynamically.

  

Steps I have followed are
1.I have created myres.en-GB.resx file at C:.
2.then created locale specific myres.en-GB.resources using resgen at c: only,
resgen c:\myres.en-GB.resx
3.Linked the Resource File to Assembly using AL.exe which is giving me assembly at c: only.
Al /t:lib /embed:myres.en-GB.resources /out:ClassLibrary1.dll
4.I have created one web application using vs 2008 & then build it.
5.Then placed both resource file & dll in web applications Bin\en-GB folder.
6.Anf finally written code at page load like
 CultureInfo info = new CultureInfo("en-GB");
            Thread.CurrentThread.CurrentCulture = info;
            Assembly asd = Assembly.Load("ClassLibrary1");
            ResourceManager res = new ResourceManager("myres.en-GB", asd.GetSatelliteAssembly(info));
            string sdf = res.GetString("Lab1");

but after running application I m getting following error
MissingManifestResourceException", "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Cla

Charset Problem with dynamically generated Word Document

  

in my asp.net web application i am dynamically generating a word documnet out of a sql data. I have set the char set UTF-8 during the doument creation in code but still when i open the generated document and check it char set .. it is always windows-1252 not the one that i have set. My sql data in the document have special characters whihc can only be understandable using the UTF-8 charset otherwise its always ?T written in place of an apostrophy . Pasting my code here..

         HttpContext.Current.Response.Clear();
         HttpContext.Current.Response.ContentType = "application/msword";
         HttpContext.Current.Response.ContentEncoding = System.Text.UnicodeEncoding.UTF8;
         HttpContext.Current.Response.Charset = "utf-8";
         string strFileName = "Details" + ".doc";
        HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;filename=" + strFileName);
        StringBuilder strHTMLContent = new StringBuilder();
        string strMessage = " ";
        DataView abstractview = (DataView)dsAbstract.Select(DataSourceSelectArguments.Empty);
        foreach (DataRowView row1 in abstractview)
        {
            strMessage += "<table border='1' cellspacing='0' cellpadding='5' width

resize png at time of uploding without loosing tranparancy of img

  

 

i have tryed so many code to resize n compress png img but after resize it loose it's tranparancy ,

any one have good code to fix this problem.



Bad quality after resize jpeg

  

Hi,

I wrote code that resize my photo to thumbnail (100x100px). The thumbnail is ok (is blur) on serwer (Windows Serwer 2008 x64) and the thumbnail is very bad (no blur and pixels are big) on serwer (Windows Serwer 2008 x86). Both serwers have framework .net 4.0.

I wrote code on VS 2010.

Below is my code:

public static void MakeThumbnail(string path, string prefix, string filename, Stream stream, string mime, int fixedWidth, int fixedHeight, bool allowCrop)
{
string newFullname = path + "\\" + prefix + filename;

//oryginalny obrazek
Image sourceOriginalImage = Image.FromStream(stream);

int width = sourceOriginalImage.Width;
int height = sourceOriginalImage.Height;

double widthD = Convert.ToDouble(width);
double heightD = Convert.ToDouble(height);
double fixedWidthD = Convert.ToDouble(fixedWidth);
double fixedHeightD = Convert.ToDouble(fixedHeight);

int newWidth = 0;
int newHeight = 0;

int cropX = 0;
int cropY = 0;

newWidth = fixedWidth;
newHeight = (int)(fixedWidthD / Xp);
cropY = Convert.ToInt32((newHeight -

Problem with Resize on x64/x86

  

Hi,

I wrote code that resize my photo to thumbnail (100x100px). The thumbnail is ok (is blur) on serwer (Windows Serwer 2008 x64) and the thumbnail is very bad (no blur and pixels are big) on serwer (Windows Serwer 2008 x86). Both serwers have framework .net 4.0.

I wrote code on VS 2010.

Below is my code:


public static void MakeThumbnail(string path, string prefix, string filename, Stream stream, string mime, int fixedWidth, int fixedHeight, bool allowCrop)
{
string newFullname = path + "\\" + prefix + filename;

//oryginalny obrazek
Image sourceOriginalImage = Image.FromStream(stream);

int width = sourceOriginalImage.Width;
int height = sourceOriginalImage.Height;

double widthD = Convert.ToDouble(width);
double heightD = Convert.ToDouble(height);
double fixedWidthD = Convert.ToDouble(fixedWidth);
double fixedHeightD = Convert.ToDouble(fixedHeight);

int newWidth = 0;
int newHeight = 0;

int cropX = 0;
int cropY = 0;

newWidth = fixedWidth;
newHeight = (int)(fixedWidthD / Xp);
cropY = Convert.T
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend