protected void Button1_Click(object sender, EventArgs e) { lbltext.Text = HiddenField1.Value; Page.RegisterStartupScript(new Guid().ToString(), "<script type='text/javascript'>alert('"+lbltext.Text+"');</script>"); // alert the label value }
protected void MyMethod(Page page) { ScriptManager.RegisterStartupScript(page, typeof(UpdatePanel), new Guid().ToString() , "jsfunction();", true); }
Guid g = new Guid(new Byte[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}); Console.WriteLine(g);
protected void Page_Load(object sender, EventArgs e) { ScriptManager.RegisterStartupScript(this.Page, typeof(UpdatePanel1) , new Guid().ToString(),"Test();",true); }
var guid = new Guid("00112233445566778899AABBCCDDEEFF"); var msBlob = guid.ToByteArray(); var msHex = BitConverter.ToString(msBlob);
public static Guid NameGuidFromBytes(byte[] input) { MD5 md5 = MD5.Create(); byte[] hash = md5.ComputeHash(input); hash[6] &= 0x0f; hash[6] |= 0x30; hash[8] &= 0x3f; hash[8] |= 0x80; byte temp = hash[6]; hash[6] = hash[7]; hash[7] = temp; temp = hash[4]; hash[4] = hash[5]; hash[5] = temp; temp = hash[0]; hash[0] = hash[3]; hash[3] = temp; temp = hash[1]; hash[1] = hash[2]; hash[2] = temp; return new Guid(hash); }
class MyStuff { private static Guid keyId = new Guid("{pre-define-xyz}"); private static MetaDataKey<String> key = new MetaDataKey<String>(keyId, typeof(String)); }
class MyStuff { private static MetaDataKey<String> key = new MetaDataKey<String>(new Guid(), typeof(String)); }
addAttribute(collection, "fieldName", new EntityReference("entityName", new Guid("id"))
try { ByteBuffer bb = ByteBuffer.allocate(16); bb.order(ByteOrder.LITTLE_ENDIAN); String[] arrSidParts = strSid.split("-"); for (int i = 4; i < arrSidParts.length; i++) { bb.putInt((int) Long.parseLong(arrSidParts[i])); } Guid guid = new Guid(bb.array(), false); out.println(guid.toString()); } catch (Exception e) { out.println("!" + e.getMessage() + "!"); e.printStackTrace(); }
_id = new Guid( idBytes ); _idInitialized = true;
public partial class vcfexport : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Authenticate using credentials of iis ClientCredentials Credentials = new ClientCredentials(); Uri OrganizationUri = new Uri("http://server/org/XRMServices/2011/Organization.svc"); Uri HomeRealmUri = null; OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, null); IOrganizationService service = (IOrganizationService)serviceProxy; String guidString = Request.QueryString["guid"]; String entityName = Request.QueryString["name"]; if (guidString != null && entityName != null && guidString != "" && entityName != "") { ColumnSet columnSet = new ColumnSet(true); Guid guid = new Guid(guidString); // retrieve the contact dataset Entity contactEntity = service.Retrieve(entityName, guid, columnSet); // create new vcard VCard vcard = new VCard(); vcard.FirstName = contactEntity.GetAttributeValue<String>("firstname"); vcard.LastName = contactEntity.GetAttributeValue<String>("lastname"); //...... String fileName = vcard.LastName + " " + vcard.FirstName + ".vcf"; Response.ContentType = "text/x-vcard"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileName); // give download window Response.Write(vcard.ToString()); Response.End(); } else { lblError.Text = "Es ist ein Fehler aufgetreten. Entityname oder guid sind falsch"; } }
public Item parseItem(Element rssRoot,Element eItem) { Item item = super.parseItem(rssRoot,eItem); item.setExpirationDate(null); Element e = eItem.getChild("author",getRSSNamespace()); if (e!=null) { item.setAuthor(e.getText()); } e = eItem.getChild("guid",getRSSNamespace()); if (e!=null) { Guid guid = new Guid(); String att = e.getAttributeValue("isPermaLink");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK if (att!=null) { guid.setPermaLink(att.equalsIgnoreCase("true")); } guid.setValue(e.getText()); item.setGuid(guid); } e = eItem.getChild("comments",getRSSNamespace()); if (e!=null) { item.setComments(e.getText()); } return item; }
public Item parseItem(Element rssRoot,Element eItem) { Item item = super.parseItem(rssRoot,eItem); item.setExpirationDate(null); Element e = eItem.getChild("author",getRSSNamespace()); if (e!=null) { item.setAuthor(e.getText()); } e = eItem.getChild("guid",getRSSNamespace()); if (e!=null) { Guid guid = new Guid(); String att = e.getAttributeValue("isPermaLink");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK if (att!=null) { guid.setPermaLink(att.equalsIgnoreCase("true")); } guid.setValue(e.getText()); item.setGuid(guid); } e = eItem.getChild("comments",getRSSNamespace()); if (e!=null) { item.setComments(e.getText()); } return item; }
protected Item createRSSItem(SyndEntry sEntry) { Item item = super.createRSSItem(sEntry); if (sEntry.getAuthors()!=null && sEntry.getAuthors().size() > 0) { SyndPerson author = (SyndPerson)sEntry.getAuthors().get(0); item.setAuthor(author.getEmail()); } Guid guid = null; String uri = sEntry.getUri(); if (uri!=null) { guid = new Guid(); guid.setPermaLink(false); guid.setValue(uri); } else { String link = sEntry.getLink(); if (link!=null) { guid = new Guid(); guid.setPermaLink(true); guid.setValue(link); } } item.setGuid(guid); return item; }
protected Item createRSSItem(SyndEntry sEntry) { Item item = super.createRSSItem(sEntry); if (sEntry.getAuthors()!=null && sEntry.getAuthors().size() > 0) { SyndPerson author = (SyndPerson)sEntry.getAuthors().get(0); item.setAuthor(author.getEmail()); } Guid guid = null; String uri = sEntry.getUri(); if (uri!=null) { guid = new Guid(); guid.setPermaLink(false); guid.setValue(uri); } else { String link = sEntry.getLink(); if (link!=null) { guid = new Guid(); guid.setPermaLink(true); guid.setValue(link); } } item.setGuid(guid); return item; }
private void doIt(OrganizationServiceStub stub, OptionSetValue state, OptionSetValue status) { OrganizationRequest request = new OrganizationRequest(); request.setRequestName("SetState"); ParameterCollection collection = new ParameterCollection(); collection.addKeyValuePairOfstringanyType(pair("State", state)); collection.addKeyValuePairOfstringanyType(pair("Status", status)); request.setParameters(collection); Guid g = new Guid(); g.setGuid("abc0def-ghi"); EntityReference ref = new EntityReference(); ref.setId(g); ref.setLogicalName("ei_teacherdetails"); collection.addKeyValuePairOfstringanyType(pair("EntityMoniker", ref)); Execute exe = new Execute(); exe.setRequest(request); stub.execute(exe); }
public Item parseItem(Element rssRoot,Element eItem) { Item item = super.parseItem(rssRoot,eItem); item.setExpirationDate(null); Element e = eItem.getChild("author",getRSSNamespace()); if (e!=null) { item.setAuthor(e.getText()); } e = eItem.getChild("guid",getRSSNamespace()); if (e!=null) { Guid guid = new Guid(); String att = e.getAttributeValue("isPermaLink");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK if (att!=null) { guid.setPermaLink(att.equalsIgnoreCase("true")); } guid.setValue(e.getText()); item.setGuid(guid); } e = eItem.getChild("comments",getRSSNamespace()); if (e!=null) { item.setComments(e.getText()); } return item; }
public Item parseItem(Element rssRoot,Element eItem) { Item item = super.parseItem(rssRoot,eItem); item.setExpirationDate(null); Element e = eItem.getChild("author",getRSSNamespace()); if (e!=null) { item.setAuthor(e.getText()); } e = eItem.getChild("guid",getRSSNamespace()); if (e!=null) { Guid guid = new Guid(); String att = e.getAttributeValue("isPermaLink");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK if (att!=null) { guid.setPermaLink(att.equalsIgnoreCase("true")); } guid.setValue(e.getText()); item.setGuid(guid); } e = eItem.getChild("comments",getRSSNamespace()); if (e!=null) { item.setComments(e.getText()); } return item; }